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

Server value in an html control 1

Status
Not open for further replies.

olypost

Programmer
Apr 15, 2005
43
US
Is it possible to call a javascript function in an html control (thru onclick, for example) and passing as a parameter to the javascript a server control dropdownlist value?

My html control:
<INPUT id="btnDone" onclick="hidedivddl();" type="button" value="Done">

The value I want to pass is a selected value from a dropdown. Can the html control reference this value so it can pass it in the javascript function?

Thanks
 
I believe you would have to use getElementbyID to get the object then pass it. Check in the javacript forum for better details..

Jim
 
jim is correct, howeve there is one property in .NET, the HTML input tags it outputs do not necessarily have the same name as the id given to them in .NET, check out the clientId property to get the Id and then from there to getElementId()...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top