locked
Get Textbox Value RRS feed

  • Question

  • User1668729249 posted

    i can't get the value

    using this code

    $('#txtempid').val()

    Error Displayed : Undefined

    how to get the textbox value using ajax

    Thursday, October 31, 2013 3:52 AM

Answers

  • User-1516073966 posted

    Hi

    Does your text box contains runat="server" attribute then use the below code for getting the value.

    $('#<%=txtempid.ClientID%>').val()
    



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 31, 2013 4:00 AM

All replies

  • User-1516073966 posted

    Hi

    Does your text box contains runat="server" attribute then use the below code for getting the value.

    $('#<%=txtempid.ClientID%>').val()
    



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 31, 2013 4:00 AM
  • User1079421601 posted

    If you do not use master page then use like

    $('#txtempid').val()

    if you use master page the use like

    $('#ctl00_ContentPlaceHolder_body_txtempid').val()  //here ContentPlaceHolder_body content place holder name of master page




    Thursday, October 31, 2013 4:04 AM