how to get the value of input text that is residing inside of a div?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rsbollocks
    New Member
    • Apr 2010
    • 2

    #1

    how to get the value of input text that is residing inside of a div?

    gud day to all guys,

    here is my first post,

    how can i get the value of the input text inside a div when the form is submitted.

    - i can get the value of hdncivil input field using this syntax

    civilstat= Request.Form("h dncivil")

    - but when using the same method/syntax to get the minAge and maxAge
    Code:
             minage= Request.Form("minAge") 
             maxage= Request.Form("maxAge")
    ----------- the value of minage and maxage contains nothing


    Code:
    <%
    hdncivil = "single"
    d_min = "18"
    d_max = "65"
    %>
    <form id="FrmMain" name="FrmMain" method="POST" action="MCHRESav.asp" >
    <input type="hidden" id="hdncivil" name = "<%=hdncivil%>"  />		
    <div id="constraints">	
      <input type="hidden" id="minAge" value="<%=d_min %>" />
      <input type="hidden" id="maxAge" value="<%=d_max %>"/>
    <div>
    <input type="submit" id="BtnSave" name="BtnSave" value="save"  />
    </form>
    thanks in advance,,
    Last edited by Frinavale; Apr 13 '10, 02:59 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Change

    Code:
    <input type="hidden" id="minAge" value="<%=d_min %>" /> 
    <input type="hidden" id="maxAge" value="<%=d_max %>"/>
    To

    Code:
    <input type="hidden" id="minAge" value="<%=d_min%>" /> 
    <input type="hidden" id="maxAge" value="<%=d_max%>"/>
    Steven

    Comment

    • rsbollocks
      New Member
      • Apr 2010
      • 2

      #3
      Originally posted by MrMancunian
      Change

      Code:
      <input type="hidden" id="minAge" value="<%=d_min %>" /> 
      <input type="hidden" id="maxAge" value="<%=d_max %>"/>
      To

      Code:
      <input type="hidden" id="minAge" value="<%=d_min%>" /> 
      <input type="hidden" id="maxAge" value="<%=d_max%>"/>
      Steven
      thanks for your reply mrMancunian, i will try, see again on my future posts,,

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        rsbollocks,

        It looks like you need to add a name property to the hidden input fields in order for you to be able to access them in your ASP server code.

        Add the "name" property to your minAge and maxAge hidden fields:
        Code:
        <input type="hidden" id="minAge" name="minAge" value="<%=d_min %>" />
        <input type="hidden" id="maxAge" name="maxAge" value="<%=d_max %>" />
        -Frinny

        Comment

        Working...