How to submit form and change value with JavaScript function?

J

Jurij P

I have a problem.
I would like to change a value from textbox with JavaScript before I submit
the form (submit updated value). Can anyone please help me?

thank you, Jure
 
P

Paul

Try something like.

On the client....
<form name="frmForm' action='default.asp'>
<input type="text" id='txtName'/>
<input type='button' onclick='jscript:changeTextbox();'>
</form>

<script language='JScript'>
function changeTextbox()
{
txtName.value = 'hello wolrd';
frmForm.submit;
}
</script>

On the server....
Use the event on the button, to change the property of the text box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top