|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How can I send parameter from each row to ajax?
For example I have 3 rows in table
<table > <tr><td>Column 1</td><td><input typ='text' name='status' value='0'></td><td><a href='#' onclick='sendToAjax()'>Update</a></td></tr> <tr><td>Column 1</td><td><input typ='text' name='status' value='1'></td><td><a href='#' onclick='sendToAjax()'>Update</a></td></tr></table> I would like to send value from status row by row to ajax script how can I do? |
|
#2
|
||||
|
||||
|
yes there is a way...
(this file is an full html file i used to create it) File name: test.html Code:
<HTML>
<HEAD>
<SCRIPT>
function getNames() {
var ibms=window.document.getElementsByName('status');
var vals=new Array();
for (var x=0;x<ibms.length;x++) {vals[x]=ibms[x].value;}
alert(vals[0]+" "+vals[1]+" "+vals[2]+" "+vals[3]); // use this to test
}
</SCRIPT>
<BODY>
<INPUT TYPE="text" VALUE="thisisnumberone" NAME="status" />
<INPUT TYPE="text" VALUE="thisisnumbertwo" NAME="status" />
<INPUT TYPE="text" VALUE="thisisnumberthree" NAME="status" />
<INPUT TYPE="text" VALUE="thisisnumberfour" NAME="status" />
<INPUT TYPE="text" VALUE="thisisnumberfive" NAME="status" />
<INPUT TYPE="button" VALUE="getInfo" onclick="getNames()" />
</BODY>
</HTML>
hope this helped!!! colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > How can I send parameter from each row to ajax? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|