Hello .. this is my problem …
I am calling this function(updateRecord) on an onclick in a link … everytime I try to access the current value in the textbox it gives me an error of “undefined” but I swear its correct, so maybe I am missing something. Or I just may not be able to do this. The way the textbox gets named is in a while loop in ASP (example below the JAVASCRIPT) Thank you to whoever helps me with this. If anyone has an easier way to do this maybe? I have tried so many tutorials.
/////////////////////////
[CODE]function updateRecord(task_id, wf_id, month, year, hoursTXT)
{
alert(“task id= “+task_id+ “| wf_ID= “+wf_id+ “| month= “+month+”| year= “+year+”| hoursTxt =”+hoursTXT);
var hoursval;
var temp;
var the_element_string = “document.myform.”+hoursTXT;
hoursval = eval(the_element_string);
temp = eval(the_element_string.text)
alert(“task id= “+hoursval+” | string= “+the_element_string+”| temp= “+temp);
//window.open(‘updaterecord.asp?task_id=’+task_id+’&WF_ID=’+wf_id+’&Month=’+month+’&Year=’+year+’&hours=’+hoursval); }
////////////
[CODE]<input type=”Text” name=”Txt<%=rs(11)%>” size=3 value=”<%= FormatNumber(rs(7), 2) %>”>
this is the link code …
[CODE]<a href=’javascript:updateRecord(<%= rs(11)%>, <%=Request.QueryString(“WF_ID”)%>,<%=Request.QueryString(“Month”)%>,<%=Request.QueryString(“Year”)%>, “Txt<%=rs(11)%>” )’>Update</a>