AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - HTML - Forms - Hidden and Submit

Hidden and Submit



HIDDEN

Forms can also contain hidden fields, ones the user can't change. There are reasons for hidden field, for example..

If you are sending the form to a script, the script might need to know other things like where to send the user once the form has been sent. So in that example you might have a hidden field that looks like this

<input type="hidden" name="redirect" value="thankyou.html">

Or, you may have lots of forms on your site and you want to identify which form was used, you could use something like this

<input type="hidden" name="what form" value="General Contact Form">

There's no need for the user to see or change those fields but we might find them useful so we hide them :)

RESET

<input type="reset" value="Start Again">
  • value : This is the text you want to have displayed on the button.

There are arguments for and against having a reset button. The worst one I heard was "if you have a reset button the visitor might change their mind about sending the form - limit their choices!" - well personally, I think if someone changes their mind they will change it with or without a reset button. By providing a reset button you give the user piece of mind that the info they entered has gone.

Consider your user at all times :)

SUBMIT

<input type="submit" name="" value="Send Form">
  • name : Optional, some form scripts require the submit to have a name. If it doesn't require a name or you are using the mailto then you can omit the name attribute.

  • value : This is the text you want to have displayed on the button.

The submit button does exactly what it says - it submits the form using the chosen action defined in the form tag.

Finally we'll look at using forms in tables.


how forms work | the form tag | text input
user options | hidden and submit | forms in tables

Why not discuss this article in our forum?
Other related guides : accessible web forms | webpage basics | lists







Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]