Presentation is loading. Please wait.

Presentation is loading. Please wait.

آموزش طراحی وب سایت جلسه سیزدهم– فرم و جاوا اسکریپت تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: 09125773990 09371410986 پست الکترونیک.

Similar presentations


Presentation on theme: "آموزش طراحی وب سایت جلسه سیزدهم– فرم و جاوا اسکریپت تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: 09125773990 09371410986 پست الکترونیک."— Presentation transcript:

1 آموزش طراحی وب سایت جلسه سیزدهم– فرم و جاوا اسکریپت تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :

2 Form & Working with JavaScript

3 forms.css /* forms style sheet */ body, input, textarea { font-family:arial, verdana, sans-serif; }.label { width:175px; float:left; text-align:right; margin:10px 5px 0px 0px;}.formElement { width:175px; float:left; margin:10px 0px 0px 0px;}.clear {clear:both;}

4 function validate(form) { var returnValue = true; var username = frmRegister.txtUserName.value; var password1 = frmRegister.txtPassword.value; var password2 = frmRegister.txtPassword2.value; if(frmRegister.txtUserName.length < 6) { returnValue = false; alert("Your username must be at least\n6 characters long.\nPlease try again."); frmRegister.txtUserName.focus(); }

5 if (password1.length < 6) { returnValue = false; alert("Your password must be at least\n6 characters long.\nPlease try again."); frmRegister.txtPassword.value = ""; frmRegister.txtPassword2.value = ""; frmRegister.txtPassword.focus(); } if (password1.value != password2.value) { returnValue = false; alter("Your password entries did not match.\nPlease try again."); frmRegister.txtPassword.value = ""; frmRegister.txtPassword2.value = ""; frmRegister.txtPassword.focus(); } return returnValue; }

6

7

Username: Password: Confirm your password:

8

9 function validate(form) { var returnValue=true; var formElements = form.elements; for (var i=0; i

10 Name: Please enter your query here:

11

12 function validate(form) { var returnValue = true; var selectedOption = form.selCards.selectedIndex; if (selectedOption=="0") { alert("Please select a suit of cards."); returnValue = false; } return returnValue; }

13 Select a suit of cards Hearts Diamonds Spades Clubs

14

15 function validate(form) { var radioButtons = form.radSuit; radioChosen = false; for (var i=0; i

16 Please select a suit of cards. Hearts Diamonds Spades Clubs

17

18 function countCheckboxes(field) { var intCount = 0 for (var i = 0; i < field.length; i++) { if (field[i].checked) intCount++; } alert("You selected " + intCount + " checkbox(es)"); }

19 Please select a suit of cards. Hearts Diamonds Spades Clubs

20

21 I understand that this software has no liability: You will not be able to submit this form unless you agree to the terms and conditions and check the terms and conditions box.

22

23 Focus on First Form Item User name Password

24

25 Auto-Tabbing Between Fields Enter your date of birth:

26

27 Disabling a Text Input function handleOther(strRadio) { if (strRadio == "other") { document.frmReferrer.txtOther.disabled = false; document.frmReferrer.txtOther.value = ''; } else { document.frmReferrer.txtOther.disabled = true; document.frmReferrer.txtOther.value = 'not applicable'; }

28 How did you hear about us? From a friend TV Ad Magazine Ad Newspaper Ad Internet Other... Please specify:

29

30 Case Conversion Enter some UPPER CASE text and when you remove the focus from the text input (by pressing tab), it will all get transformed to lower case. Enter some lower case or mixed case text and when you remove the focus from the text input (by pressing tab), it will all get transformed to upper case.

31


Download ppt "آموزش طراحی وب سایت جلسه سیزدهم– فرم و جاوا اسکریپت تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: 09125773990 09371410986 پست الکترونیک."

Similar presentations


Ads by Google