By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,569 Members | 1,181 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,569 IT Pros & Developers. It's quick & easy.

purpose of using forms/get form textbox value in JavaScript function

P: 51
hi there,
Can anybody tell me the purpose of using forms in a html code ? I am using a form with method="post" and using the form name i am getting the values onto a javascript function.

cheers,
pavan
Jul 16 '08 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
The purpose of forms is to gather user input. What exactly are you trying to do?
Jul 16 '08 #2

P: 51
The purpose of forms is to gather user input. What exactly are you trying to do?
hi ,
I am using the values inside textboxes etc inside a javascript function.
So is it necessary to give form name in a javascript function ? Is there
any alternate method to pass th value to a javascript method?
Jul 17 '08 #3

acoder
Expert Mod 15k+
P: 16,027
Post your code so that I have a better idea.

You can access the form using the form name, e.g. document.forms[formName].elements[elementName].value. Alternatively, give the element an ID and use document.getElementById().

PS. I'm moving this to the JavaScript forum since it's a JavaScript problem.
Jul 17 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.