Reputation: 25
I have been trying to pass the following 2 parameters to a procedure during the form load it works with one but not with two can anyone advise?
<body onload="UpdateButton(<%=esr_link%>,<%=job%>)">
function UpdateButton(Link,Title)
{
if (Link == 1)
{
alert('Updatebutton=1')
document.getElementById("staff").innerHTML = "Trust Staff " + Title
}
else
{
document.getElementById("staff").innerHTML = "Non Trust Staff " + Title
}
}
Upvotes: 0
Views: 33
Reputation: 8652
the output of this:
<body onload="UpdateButton(<%=esr_link%>,<%=job%>)">
probably looks a little like this :
<body onload="UpdateButton(1,salesman)">
you're missing the quotes around "job". try the following :
<body onload="UpdateButton(<%=esr_link%>,'<%=job%>')">
Upvotes: 1