AllExperts > Experts 
Search      

VB Script

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More VB Script Answers
Question Library

Ask a question about VB Script
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Shantanu Khasnavis
Expertise
I will be comfortable with most of the questions in ASP, VB Script. In SQL I am well versed from a developers point. I am also comfortable in application dev. in VB though not very confident in COM DCOM but will try to find an ans and reply if I am stuck.

Experience
I have 3 yrs exp in VB, ASP and SQl Server 7 in various MNC's. Presently I working with an MNC in New Delhi, India as a software developer.

Education/Credentials
I am a bachelor in Engineering.

 
   

You are here:  Experts > Computing/Technology > Basic > VB Script > combo box and ASP

Topic: VB Script



Expert: Shantanu Khasnavis
Date: 1/7/2002
Subject: combo box and ASP

Question
Hello,

The extract of following form is passed on in a file ASP. which is the solution to get back the values 0,1,2 and not the words London, Madrid, Paris. I would like to store these numbers in a Access database (and not the words).

   <select name="town" size="1">
     <option value="0">London</option>
     <option value="1">Madrid</option>
     <option value="2">Paris</option>
   </select>

These two solutions do not work. I always obtain 0

Record.Fields("town")=cint(Request.Querystring("town"))
Record.Fields("town")=cint(Request.Form("town"))

Thank you in advance  

Answer
Dear gordon dilan
I have tried the script and find no possibility why it is giving a problem. It is working fine here.
In any case I'm pasting athe codes. Try it out.

main.htm
---------------------------------------------

<html>
<head>
<title>Select One Country</title>
</head>

<body>
<form method=post action="test.asp">
  <select name="town">
 <option value="0">London</option>
 <option value="1">Madrid</option>
 <option value="2">Paris</option>
 </select>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
</body>
</html>
-----------------------------------------------------

test.asp
-------------------------------------
<%
response.write cint(Request.form("town"))
%>
<html>

<head>
<title>Your Selection</title>
</head>

<body>

</body>

</html>

------------------------------------------------------

See the result for yourself.  

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.