Welcome visitor
* Login
* Register
It is currently March 21st, 2019, 11:52 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  Mandatory fields
PostPosted: September 25th, 2009, 5:15 am 

Posts: 18
I've already learned how to create a form but i dont know how to make some fields mandatory, so if they are not filled the form will not be submitted. Is there something that I need to add to the fields that I want to set as requiered fields?


Top
 Profile  
 
  Re: Mandatory fields
PostPosted: September 25th, 2009, 5:49 am 

Posts: 96
No, there's not an additional attribute. Rather, you need to create a script to validate that the form was properly filled, and then submit it or refuse it.
Here're some links with a bit of a validation like that ran on the client side:
http://www.scriptingok.com/forum/viewtopic.php?f=12&t=77
and a bit of code like this helps you to go through all the form elements
for(i=0; i<document.forms[0].elements.length; i++){
if(document.forms[0].elements[i].value==''){}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron