SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Required Fields
-
Oct 28, 2008, 11:23 #1
Required Fields
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?aj
The journey of a thousand miles begins with a single step...
-
Oct 28, 2008, 12:25 #2
- Join Date
- Jul 2005
- Location
- Venezuela
- Posts
- 224
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Oct 28, 2008, 13:04 #3
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Oct 28, 2008, 13:15 #4
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 .. thanksaj
The journey of a thousand miles begins with a single step...
Bookmarks