I have an ASP page which displays a row of data for each record in my database. For each record I want to display a view submit form button which when pressed, will pass the userID for the relevant record only to a separate ASP page using the form post method. e.g. "24"
Within my table is the following for each record...
and at the top of the page is the JavaScript function...
function viewrecord( userID )
{
// set the value of the hidden form field to the userID
document.form1.UserIDField.value = userID;
alert( "Now going to view the following record: " + userID + "; value of form field is: " + document.form1.UserIDField.value );
}
Problem
However, the UserIDField is being passed all of the userIDs (i.e. "23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 1, 2, 3, 4, 5") rather than just the individual one I want (i.e. "18") even though the alert box is displaying the correct value of the individual record (e.g. "18").
Bookmarks