passing a textbox value to a javascript function asp.net -


i having little difficulty one. trying pass textbox value javascript function , undefined instead.

advice perhaps on how can variable function

<input type="image" runat="server" id="btnsearchfunction" src="images/searchicon.png" name="image" onclick="searchcontent();" width="16" height="20" /> <input type="hidden" name="searchvalue" value="<%#txtsearch.value %>" /> <input type="text" runat="server" id="txtsearch" name="searchvalue" class="input-medium search-query" placeholder="search ..."/> 

and function trying pass to

function searchcontent() {     var txtboxvalue = $(this).parent().find("input[name='searchvalue']").val();     alert(txtboxvalue); } 

how more direct:

var txtboxvalue = $('#txtsearch').val(); alert(txtboxvalue); 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -