468,544 Members | 1,814 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,544 developers. It's quick & easy.

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

rsbollocks
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("hdncivil")

- but when using the same method/syntax to get the minAge and maxAge
Expand|Select|Wrap|Line Numbers
  1.          minage= Request.Form("minAge") 
  2.          maxage= Request.Form("maxAge") 
  3.  
----------- the value of minage and maxage contains nothing


Expand|Select|Wrap|Line Numbers
  1. <%
  2. hdncivil = "single"
  3. d_min = "18"
  4. d_max = "65"
  5. %>
  6. <form id="FrmMain" name="FrmMain" method="POST" action="MCHRESav.asp" >
  7. <input type="hidden" id="hdncivil" name = "<%=hdncivil%>"  />        
  8. <div id="constraints">    
  9.   <input type="hidden" id="minAge" value="<%=d_min %>" />
  10.   <input type="hidden" id="maxAge" value="<%=d_max %>"/>
  11. <div>
  12. <input type="submit" id="BtnSave" name="BtnSave" value="save"  />
  13. </form>
thanks in advance,,
Apr 12 '10 #1
3 2444
MrMancunian
569 Expert 512MB
Change

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" id="minAge" value="<%=d_min %>" /> 
  2. <input type="hidden" id="maxAge" value="<%=d_max %>"/>
To

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" id="minAge" value="<%=d_min%>" /> 
  2. <input type="hidden" id="maxAge" value="<%=d_max%>"/>
Steven
Apr 17 '10 #2
@MrMancunian
thanks for your reply mrMancunian, i will try, see again on my future posts,,
Apr 18 '10 #3
Frinavale
9,735 Expert Mod 8TB
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:
Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" id="minAge" name="minAge" value="<%=d_min %>" />
  2. <input type="hidden" id="maxAge" name="maxAge" value="<%=d_max %>" />
-Frinny
Apr 19 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Oleg Konovalov | last post: by
2 posts views Thread by Angus Parvis | last post: by
3 posts views Thread by JK | last post: by
3 posts views Thread by Justin Morris via DotNetMonster.com | last post: by
2 posts views Thread by charles-brewster | last post: by
2 posts views Thread by Scott | last post: by
4 posts views Thread by frank78 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.