473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Getting selected option

Simple question:
I have s selection box after the user makes a selection I want to capture the selection and use it to go to my database. How do I do it?
Sep 7 '06 #1
1 1836
phpmaet
27
Hi,
This code very useful for you. try this code,


Expand|Select|Wrap|Line Numbers
  1. <form method=post action=form-checkboxck.asp>
  2. <input type=checkbox name=t1 value='PHP'>PHP
  3. <input type=checkbox name=t1 value='ASP.NET'>ASP.NET
  4. <input type=checkbox name=t1 value='PEAR'>PEAR
  5. <input type=checkbox name=t1 value='JAVA'>JAVA
  6. <input type=submit value='Submit'>
  7. </form>
The form is submitted then the values of the checked checkboxes.


Expand|Select|Wrap|Line Numbers
  1. Dim mode,mode_a,i
  2. mode=Request("t1")
Let us split the string to get the array of checked values.

Expand|Select|Wrap|Line Numbers
  1. mode_a=split(mode,",")
Using 'For' loop and 'LBound/UBound' function to print out the checked values of the checkboxes.


Expand|Select|Wrap|Line Numbers
  1. For i=LBound(mode_a) to UBound(mode_a)
  2. Response.Write mode_a(i) + "<br>"
  3. Next
Thanks
Sep 8 '06 #2

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

Similar topics

19
by: harry | last post by:
Just want to traverse a listbox's (multi select) items & for those that are selected extract the displayed text - something like below - function getSelectedDescrs(lst) { var buf; var maxItems...
1
by: bagya | last post by:
please help me out the following is the small code i have <html> <head> <script type="text/javascript"> function validate() { if (document.abc.region.value==0)
1
by: Mitesh | last post by:
Hi, I have the following HTML code right now. Code: ------------------------------------------------------------------------------------------------------------------------- <td...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
3
by: bettor | last post by:
I have the following html code: <form method="get"> <select name="zoni" onchange="showCustomer(this.value)"> <option value="0" selected="selected"></option> <option value="1">zone А</option>...
10
by: patsman77 | last post by:
I hope this is the right spot to post this.... I am working on a form to pull the information from the database. I am trying to use arrays, but I only get one record to come back and it is...
1
by: gubbachchi | last post by:
Hi, How can I get the selected item of the drop down box into a php variable in the same page. The options in drop down box are A,B and C and the code is here <select> <option value="Item...
45
by: angelicdevil | last post by:
i have 2 tables 1 is status_type with field name status and other is users with field username and status now i want that the first listbox lists all status from status type ( this i have achieved...
9
vikas251074
by: vikas251074 | last post by:
I am not getting date value in spite of my good effort. This code was working in my last office where I work. Now I am trying to work at my home pc. but not getting date value. Any can help me why...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.