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

Slides:



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

آموزش طراحی وب سایت جلسه هشتم – طراحی یک تمپلیت تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
PHP Workshop ‹#› Forms (Getting data from users).
© Anselm SpoerriInfo + Web Tech Course Information Technologies Info + Web Tech Course Anselm Spoerri PhD (MIT) Rutgers University
SE-2840 Dr. Mark L. Hornick 1 HTML input elements and forms.
آموزش طراحی وب سایت جلسه یازدهم – جاوا اسکریپت 2 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
آموزش طراحی وب سایت جلسه نهم – نکات تکمیلی سی اس اس تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک.
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Principles of Web Design 6 th Edition Chapter 11 – Web Forms.
آموزش طراحی وب سایت جلسه دهم – جاوا اسکریپت 1 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Tutorial #9 – Creating Forms. Tutorial #8 Review – Tables Borders (table, gridlines), Border-collapse: collapse; empty-cells: show; and rowspan, colspan.
JavaScript Form Validation
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
Forms and Form Controls Chapter What is a Form?
Jquery IS JQuery Jquery Example of mouseover event that shows a submenu when menu selected: $(‘#menu’).mouseover(function() { $(‘#submenu’).show();
آموزش طراحی وب سایت جلسه سوم– لینک ها و آدرس دهی تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
آموزش طراحی وب سایت جلسه پانزدهم – بهینه سازی برای موتور جستجو تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست.
Suzanne J. Sultan Javascript Lecture 2. Suzanne J. Sultan function What is a function> Types of functions:  Function with no parameters  Function with.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
آموزش طراحی وب سایت جلسه چهارم– سی اس اس 1 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
Method=post 1. Text field 2. Password field 3. Checkbox field 4. Radio field 5. Submit 6. Reset.
G053 - Lecture 16 Validating Forms Mr C Johnston ICT Teacher
HTML Forms.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
1 Form Elements  Form elements have properties: Text boxes, Password boxes, Checkboxes, Option(Radio) buttons, Submit, Reset, File, Hidden and Image.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
آموزش طراحی وب سایت جلسه دوم – جداول تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
Session 8: Working with Form iNET Academy Open Source Web Development.
Client-Side programming with JavaScript 2. Event-driven programs and HTML form elements event-driven programs  onload, onunload  HTML forms & attributes.
آموزش طراحی وب سایت جلسه چهاردهم- استانداردهای طراحی سایت تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Week 10: HTML Forms HNDIT11062 – Web Development.
آموزش طراحی وب سایت جلسه پنجم– سی اس اس 2 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
Web Forms and Calculations in JavaScript. Web Forms.
FORM VALIDATION (Java Script ). Required Fields A required field in a form is a field that MUST have at least some content before the form will be processed.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
Event Handlers Events are asynchronous. When an event occurs, JavaScript can execute code in response to the user’s action. This response to the user-initiated.
Web Forms. Web Forms: A form allows our web visitors to submit information to us. Some examples uses for forms are to let the web user contact us, fill.
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
Client-Side Internet and Web Programming
Making your HTML Page Interactive
PHP: Forms FdSc Module 109 Server side scripting and Database design
Introduction to HTML Forms and Servlets
CS3220 Web and Internet Programming HTML Tables and Forms
EXCEPTION HANDLING IN SERVER CLIENT PROGRAMMING
HTML Forms Pat Morin COMP 2405.
Principles of Software Development
>> More on HTML Forms
FORMS Explained By: Sarbjit Kaur.
Getting User Input with Forms
>> Form Data Retrieval in JavaScript
BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES
ARUSHA TECHNICAL COLLEGE WEB DESIGN(html forms)
Web Programming– UFCFB Lecture 17
HTML/XHTML Forms 18-Sep-18.
Creating Form Elements
Web Development & Design Foundations with H T M L 5
Forms Data Entry and Capture
CS3220 Web and Internet Programming HTML Tables and Forms
Principles of Web Design 5th Edition
HTML Forms 18-Apr-19.
© Hugh McCabe 2000 Web Authoring Lecture 8
Making your HTML Page Interactive
Unit 5 Create Forms.
Presentation transcript:

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

Form & Working with JavaScript

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;}

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(); }

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; }

<form name="frmRegister" method="post" action="register.aspx" onsubmit="return validate(this);"> Username: Password: Confirm your password:

function validate(form) { var returnValue=true; var formElements = form.elements; for (var i=0; i<formElements.length; i++) { currentElement=formElements[i]; if (currentElement.value=="" && currentElement.className=="required") { alert("The required field \" "+currentElement.name+"\" is empty. Please provide a value for it."); currentElement.focus(); returnValue = false; break; } return returnValue; }

<form name="frmEnquiry" method="post" action="register.aspx" onsubmit="return validate(this);"> Name: Please enter your query here:

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; }

<form name="frmCards" action="cards.asp" method="get" onsubmit="return validate(this)" > Select a suit of cards Hearts Diamonds Spades Clubs

function validate(form) { var radioButtons = form.radSuit; radioChosen = false; for (var i=0; i<radioButtons.length; i++) { if (radioButtons[i].checked) { radioChosen=true; returnValue = true; } if (radioChosen == false) { returnValue = false; alert("You did not select a suit of cards"); } return returnValue; }

<form name="frmCards" action="cards.aspx" method="post" onsubmit="return validate(this)" > Please select a suit of cards. Hearts Diamonds Spades Clubs

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)"); }

Please select a suit of cards. Hearts Diamonds Spades Clubs

I understand that this software has no liability: <input type="checkbox" value="0" name="chkAgree" id="chkAgree" onclick="document.frmAgree.btnSubmit.disabled=false" /> You will not be able to submit this form unless you agree to the terms and conditions and check the terms and conditions box.

Focus on First Form Item User name Password

Auto-Tabbing Between Fields Enter your date of birth: <input name="txtMonth" id="txtMonth" size="3" maxlength="2" onkeyup="if(this.value.length>=2) this.form.txtDay.focus();"/> <input name="txtDay" id="txtDay" size="3" maxlength="2" onkeyup="if(this.value.length>=2) this.form.txtYear.focus();" /> <input name="txtYear" id="txtYear" size="5" maxlength="4" onkeyup="if(this.value.length>=4) this.form.submit.focus();" /> <input type="submit" name="submit" value="Send" />

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'; }

<body onload="document.frmReferrer.txtOther.disabled=true; document.frmReferrer.txtOther.value='not applicable' "> How did you hear about us? <input type="radio" name="radHear" value="1" onclick="handleOther(this.value);" />From a friend <input type="radio" name="radHear" value="2" onclick="handleOther(this.value);" />TV Ad <input type="radio" name="radHear" value="3" onclick="handleOther(this.value);" />Magazine Ad <input type="radio" name="radHear" value="4" onclick="handleOther(this.value);" />Newspaper Ad <input type="radio" name="radHear" value="5" onclick="handleOther(this.value);" />Internet <input type="radio" name="radHear" value="other" onclick="handleOther(this.value);" />Other... Please specify:

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. <input type="text" name="case" size="20" onblur="this.value=this.value.toLowerCase();" /> 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. <input type="text" name="case" size="20" onblur="this.value=this.value.toUpperCase();" />