Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a text box and a submit button . I want to print the value entered in a text box and print on the same page. I am calling the javascript file using an external file
Posted

It isn't that difficult. Handle the client-side click event for the button, retrieve the value of the textbox, output it. What part of this process are you having difficulty with? What have you tried so far?

function OnSubmit()
{
   var txt = document.getElementById("textbox");
   alert(txt.innerText);
}
 
Share this answer
 
Comments
Hiren solanki 11-Jan-11 8:15am    
that was good and easy answer. +5
Sergey Alexandrovich Kryukov 11-Jan-11 10:37am    
Yes, it is - my 5.
jQuery is your friend http://api.jquery.com/category/events/[^]

Look at the demo http://api.jquery.com/change/[^]

Regards
Espen Harlinn
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900