Click here to Skip to main content
12,997,210 members (80,905 online)
Rate this:
Please Sign up or sign in to vote.
There is an XHTML form including 3 text boxes and a submit button.
When the submit button is pressed the data in the text boxes must be submitted and they should identified by JavaScript and should pass those variable values to an alert!

How could I able to do that!
Posted 29-Oct-11 4:52am
Updated 29-Oct-11 4:53am
Uday P.Singh 29-Oct-11 12:09pm
you could have googled it first.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

When you say submit, you imply you are sending the values back to the server. If you want to use JavaScript to get the values out form fields and present them in an alert, this is what you might do:

function showValues() 
<input type="text" id="txtMsg" />
<input type="button" value="click me!" id="btnRun" onclick="showValues();" />
Chiranthaka Sampath 29-Oct-11 11:08am
Thanks a lot!
Uday P.Singh 29-Oct-11 12:09pm
simple 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 29 Oct 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100