Hi..
I am building a form, and I want to make some of the fields mandatory/required... can this be done simply with xhtml or do i need to use something else?
Printable View
Hi..
I am building a form, and I want to make some of the fields mandatory/required... can this be done simply with xhtml or do i need to use something else?
Uhm, xhtml is for data markup. Validation is behavior, you have to use either Javascript (for client side validation) or, better, a server side technology (PHP, etc) to validate data.
If you don't understand much of what I said, you're on the start of a very interesting path (web development is quite fun, hehe). Read some books ;)
Hi AJ,
You're going to have to use a server-side programming language (such as PHP) to handle the validation and "required" parts of the form. Of course, you'll have to use HTML to "mark up" the required elements so the user can know which parts of the form have to be filled out (or else), but the script that processes the form would handle the actual work to see if the required fields were filled out.
You can use JavaScript to "pre-validate" the form, but it will only help as an assistant rather than actually handle the validation itself. If you'd like to see a good example, check this out (made by a friend of mine for someone else). http://www.cutcodedown.com/for_other...on/contact.php
The directory is unlocked, and the PHP source files are available by clicking on the .phps files (you can view them directly in your browser). Also note that the fieldset containing the submit button should be removed - a DIV is better used there.
Hey everyone.. thanks for the info..
joaquin_win i have a lot of catching up to do.. but it's going well so far
again .. thanks