Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Javascript HTML XHTML WebForms , +
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 5:52am
Edited 29-Oct-11 5:53am
Uday P.Singh at 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 at 29-Oct-11 11:08am
Thanks a lot!
Uday P.Singh at 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
0 OriginalGriff 410
1 Sergey Alexandrovich Kryukov 370
2 Maciej Los 285
3 ProgramFOX 275
4 CHill60 260
0 OriginalGriff 360
1 ProgramFOX 265
2 Maciej Los 235
3 CHill60 200
4 RyanDev 170

Advertise | Privacy | Mobile
Web03 | 2.8.150331.1 | Last Updated 29 Oct 2011
Copyright © CodeProject, 1999-2015
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