הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 01-11-06, 16:24   # 5
-VladK-
הוסטסניון
 
-VladK-'s Avatar
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
גיל: 35
הודעות: 2,182

-VladK- לא מחובר  

ציטוט:
נכתב במקור על ידי בניה
תגדיר אותו בתחילת הסקריפט מחוץ לפונקציות ותשנה את הערכים שלו בתוך הפונקציות.
בעעע אבל זה לא מה שרציתי...אהההם כנראה מה שרציתי לעשות לא נכון...אהההם...

תראה:

יש לי 3 פונקציות:
HTML קוד:
function checking(inputs,dimg,leng,a) {
	if(document.getElementById(inputs).value.length >= leng) {
		document.getElementById(dimg).src='img/v.png';
		return true;
	} else {
		document.getElementById(dimg).src='img/x.png';
		return false;
	}
}

function passmatch(pass1,pass2,dimg) {
	if(document.getElementById(pass1).value == document.getElementById(pass2).value) {
		document.getElementById(dimg).src='img/v.png';
		return true;
	} else {
		document.getElementById(dimg).src='img/x.png';
		return false;
	}
}

function emailcheck(email,dimg) {
	var reg = new RegExp(/^[\w\-\.]+\@[\w\-\.]+\.[\w\-]+$/);

	if(email.match(reg)) {
		document.getElementById(dimg).src='img/v.png';
		return true;
	} else {
		document.getElementById(dimg).src='img/x.png';
		return false;
	}
}
אשר נבדות באמצעות הקוד:
PHP קוד:
function register(){
return 
'
<form method="post" action="?page=register">
<table>
<tr>
<td colspan="2" class="regtit">שם משתמש וסיסמא</td>
</tr>

<tr>
<td class="descarea">שם משתמש:</td>
<td><input type="text" name="username" id="username" onblur="checking(this.id, \'tick1\', 3);" class="inputt" size="60" />
<img src="img/none.gif" id="tick1" alt="" /></td>
</tr>

<tr>
<td class="descarea">סיסמא:</td>
<td><input type="password" name="password" id="password" onblur="checking(this.id, \'tick2\', 3); passmatch(\'password\', \'repassword\', \'tick3\');" class="inputt" size="60" />
<img src="img/none.gif" id="tick2" alt="" /></td>
</tr>

<tr>
<td class="descarea">סיסמא: <span style="color: #ff0000; font-size: 10px;">(שוב)</span></td>
<td><input type="password" name="password" id="repassword" onblur="checking(this.id, \'tick3\', 3); passmatch(\'password\', \'repassword\', \'tick3\');" class="inputt" size="60" />
<img src="img/none.gif" id="tick3" alt="" /></td>
</tr>

<tr>
<td class="descarea">דואר אלקטרוני:</td>
<td><input type="text" name="email" id="email" onblur="emailcheck(this.value, \'tick4\');" class="inputt" size="60" />
<img src="img/none.gif" id="tick4" alt="" /></td>
</tr>

<tr>
<td colspan="2" class="regtit">מידע לשיחזור סיסמא</td>
</tr>

<tr>
<td class="descarea">שאלה:</td>
<td><input type="text" name="question" id="question" onblur="checking(this.id, \'tick5\', 3);" class="inputt" size="60" />
<img src="img/none.gif" id="tick5" alt="" /></td>
</tr>

<tr>
<td class="descarea">תשובה:</td>
<td><input type="text" name="answer" id="answer" onblur="checking(this.id, \'tick6\', 3);" class="inputt" size="60" />
<img src="img/none.gif" id="tick6" alt="" /></td>
</tr>

<tr>
<td class="descarea">תאריך לידה:</td>
<td><input type="text" name="birth" id="birth" onblur="checking(this.id, \'tick7\', 3);" class="inputt" size="60" />
<img src="img/none.gif" id="tick7" alt="" /></td>
</tr>

<tr>
<td colspan="2" class="regtit">פרטים אישיים</td>
</tr>

<tr>
<td class="descarea">שם פרטי:</td>
<td><input type="text" name="name" id="name" onblur="checking(this.id, \'tick8\', 3);" class="inputt" size="60" />
<img src="img/none.gif" id="tick8" alt="" /></td>
</tr>

<tr>
<td class="descarea">שם משפחה:</td>
<td><input type="text" name="lastname" id="lastname" onblur="checking(this.id, \'tick9\', 3);" class="inputt" size="60" />
<img src="img/none.gif" id="tick9" alt="" /></td>
</tr>

<tr>
<td class="descarea">מין:</td>
<td><input type="text" name="sex" id="sex" onblur="checking(this.id, \'tick10\', 3);" class="inputt" size="60" />
<img src="img/none.gif" id="tick10" alt="" /></td>
</tr>

<tr>
<td></td>
<td><input type="submit" value="הרשמה למערכת" name="sendf" class="inputs" /></td>
</tr>
</table>
</form>'
;

עכשיו כיצד אני יוכל לבדוק אם כל הבדיקות שלי מחזירות אמת?
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 09:14.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ