Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set a hidden form variables value

Status
Not open for further replies.

donniea21

MIS
Feb 16, 2001
75
US
this function receives the row number from a looped recordset. I want to set a hidden form variable to the row number when they click a radio button next to the result row

function editRow(row)
{
var i = row

document.forms[0].edit.disabled = false;
document.forms[0].recordNo.value=i;
}

<input type=&quot;hidden&quot; name=&quot;recordNo&quot; value=&quot;&quot;>

what am i doin wrong??Thanks
 
Why do you think you are doing something wrong. Are you getting an error ?? It looks OK to me from here.

TW
 
sorry, i forgot to tell you what was happening..The value does not get set..it remains value=&quot;&quot;...
 
OK, let's troubleshoot this as I copied your code and it worked fine over here.

#1: Make sure your hidden form field is inside of the first set of form tags in your document. Otherwise adjust your forms[#] reference accordingly.

#2: Let's try to find out if the problem is in the i variable. In the line

document.forms[0].recordNo.value=i

Remove the variable reference and just put any old value in there. Is it still coming up empty ??

If you're still having problems, try posting a little more code. Possibly the entire formset, and all your JS script set. I would also want to know what is firing editRow().

TW
 
Oh, one more thing if you're still stuck. What are you using to read the hidden form field. ASP, PHP, Server Side CGI ??

TW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top