SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: javascript and forms
-
May 21, 2002, 15:38 #1
javascript and forms
how do I grab form values using javascript?
is it different for each type of form element?Free Science Homework Help
http://www.physicsforums.com
-
May 22, 2002, 10:41 #2
- Join Date
- Oct 2001
- Location
- Whistler BC originally from Guelph Ontario
- Posts
- 2,175
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Nope. Pretty simple really.
document.formname.elementname.value
This works for hidden, text and textareas
To find out if something is checked
document.formname.elementname.checked (if it is true it is check and if it is falses it isn't checked)
You can also pass the variables into a function needing less typing. Take this example
<input type="text" name="ele1" id="ele1" onchange="validate('string',this.value) />
This will pass the value directly meaning you don't need to reference it at all. Just check it in your function (if you create said function)
Maelstrom Personal - Apparition Visions
Development - PhP || Mysql || Zend || Devshed
Unix - FreeBSD || FreeBsdForums || Man Pages
They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.
-
May 22, 2002, 12:06 #3
cool! thanks
Free Science Homework Help
http://www.physicsforums.com
Bookmarks