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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem passing a form variable to a function

Status
Not open for further replies.

tamak

Programmer
Sep 6, 2006
19
US
I have a relatively simple thing Im working on thats generating a javascript error (formfield 'has no properties')...

The error only appears in non-i.e. browsers though - namely, firefox and netscape...


I have ASP page that contains a form field (that holds the ID value of the 'record' retunred in my recordset - pulled from a simple database)... the id of this form field is simply 'idvalue'.

I have the form field that holds the id value 'hidden' (i.e. type =hidden) and have a hyperlink right after it that has the following function call:

Code:
onClick="showEvents(idvalue.value);"


the function that the value is passed to always fails because it says that idvalue has no properties... heres the function:

Code:
function showEvents(str)
{ 
var url="showMediaRecord.asp?sid=" + Math.random() + "&ID=" + str
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)

}
 
>onClick="showEvents(idvalue.value);"
[tt]onClick="showEvents([blue]document.getElementById('[/blue]idvalue[blue]')[/blue].value);"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top