הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 21-06-09, 11:04   # 1
Megnum
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: May 2007
מיקום: אשד
הודעות: 1,308

Megnum לא מחובר  

גאווה סקריפט | לא מוצא את הבעיה

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

הינה הקוד:
HTML קוד:
<html dir="rtl">
<head>
<title>s</title>
<script  language="javascript">
function check_error(id) {

if (document.contact.id.length < 2) {
document.getElementById(id).style.border="1px dotted #58B52D";
document.getElementById(id).style.background="url(accept.png) left no-repeat 10px;";
}

else {
document.getElementById(id).style.border="1px dotted red";
}

}


</script>
<style>
form.contact {width: 550px; background: url(icon_contact.gif) left top no-repeat 60px;}
input.type {border: 1px  dotted black; margin-top: 6px; color: #808080; width: 310px; font-size: 11px;}
input.submit {border:  0px; font-size:11px; color: #FF5900; width: 80px; text-align: right; font-weight: bold; background: none; font-wieght: bold; font-size: 11px;}
textarea.content {margin-top: 6px; font-size: 11px;  border: 1px  dotted #BFBFBF; font-family: "ariel", sans-serif; color: #808080; background: url(contact.gif) top repeat-x;}
h3 { margin:  1px 1px 1px 1px; font-family:ariel, sans-serif ;}
</style>


</head>
<body>
<form method="post" action="" name="contact" class="contact" onload="void();">
<table>
</table>
<h3>פנייה ישירה בטלפון: 0546280268</h2>
<input type="text" class="type" name="first_name"  value='*שם פרטי' onclick="this.value=''" onkeypress="check_error('first_name');" /><br />
<input type="text" class="type" name="last_name"  value='*שם משפחה' onclick="this.value=''" onkeypress="check_error('last_name');" /><br />
<input type="text" class="type" name="email"  value='*דואר אלקטרוני' onclick="this.value=''" onkeypress="check_error('email');"/><br />
<input type="text" class="type" name="phone"  value='טלפון' onclick="this.value=''" onkeypress="check_error('phone');" /><br />
<input type="text" class="type" name="pelephone"  value='פלאפון' onclick="this.value=''" onkeypress="check_error('pelephone');" /><br />
<input type="text" class="type" name="fax"  value='פקס' onclick="this.value=''" onkeypress="check_error('fax');" /><br />
<textarea name="content" class="content" onkeyup="check_error('content');" rows="10" cols="70">רשום כאן את תוכן הפנייה</textarea>
</form> 











</body>
</html>

תודה לעוזרים!
  Reply With Quote
ישן 21-06-09, 11:22   # 2
mlnn
משתמש - היכל התהילה
 
mlnn's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: בחדר של חני
גיל: 35
הודעות: 4,417

mlnn לא מחובר  

תבדוק ככה
קוד:
document.getElementById(id).value.length < 2
ואיך אתה מצפה לגשת לזה בעזרת id אם אתה לא כותב את הid בInput?

עריכה:
גם אתה בודק בכלל שאם זה קטן מ2 אז שיצבע לירוק... לא אדום..
__________________
.

בחורות ערומות

Last edited by mlnn; 21-06-09 at 11:26..
  Reply With Quote
ישן 21-06-09, 12:05   # 3
Megnum
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: May 2007
מיקום: אשד
הודעות: 1,308

Megnum לא מחובר  

תודה רבה אפילו לא שמתי לב לזה.
  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. הזמן כעת הוא 22:35.

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