Monday, October 8, 2012

GetValue via JavaScript

Get values from asp.net controls like TextBox, RadioButtonList, DropDownList, CheckBoxes...

http://www.dotnetfunda.com/articles/article72.aspx

Get TextBox Sample


<table>
   <tr>
      <th colspan="2" align="left">TextBox Value in JS:</th>
   </tr>
   <tr>
      <td>
         <asp:TextBox ID="txt1" runat="server"></asp:TextBox>
      </td>
      <td>
         <input type="button" value="Submit" onclick="GetTextBoxValue('<%= txt1.ClientID %>')" />
      </td>
  </tr>
</table>

No comments: