Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Submit a form


Message #1 by "Inge Larsson" <inge.larsson@f...> on Mon, 14 May 2001 14:07:29
do something like this:

your_form.action += '&textbox_name=' + textbox.name + '&textbox_val=' +
textbox.value;

hope this will help

-----Original Message-----
From: Inge Larsson [mailto:inge.larsson@f...]
Sent: Monday, May 14, 2001 2:07 PM
To: javascript
Subject: [javascript] Submit a form


Hi,

I have a table with many text boxes in its cells. The user is supposed to
fill in data in these boxes where he/she likes, and when the focus change
to another element on the page, I want the filled in value to be stored in
a database according to which textbox was changed.

Below, I give a downsized example of what I am doing. I want the
submithandler.asp page to chose only the single value that was changed,
and store this value properly in a database. To do this, I need to know
which text box was changed.

My question: Is it possible to give the name of the changed text box as an
argument to the submit method (and possible to get in the asp page) in
some way? If so, how? Or can I achieve what I want in some other way?

<form action="../asp/submithandler.asp" method="post">
<table>
<tr>
<td>
<input type="text" onchange="change_actions(this)" name="item10" value="">
</td>
<td>
<input type="text" onchange="change_actions(this)" name="item11" value="">
</td>
<tr>
</table>
</form>

function change_actions(textbox) {
	textbox.form.submit()
	alert("Value registred for " + textbox.name)
}

Any tip on this matter is very appreciated!

Regards,
Inge Larsson


  Return to Index