472,378 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to get Radio button value in the same form

33
Hi,

I have an ASP page that contains 3 radio buttons and a combo box.
The combo box is to be populated depending on the option selected above. I am using Access DB. I want the value/checked status/on-off of the radio buttons to include a criteria in the where condition of the select query for populating the combo. How can I get its value (in the same page)?

Thnks in advance

Matsam
.
Jul 19 '07 #1
2 4550
jhardman
3,406 Expert 2GB
Matsam,

You can't. But there are some tricks you can use to make it look like you do.

Trick 1: Open the db and make the three different versions of the drop-down box you could need, but hide them (<select ... style="visibility: hidden;">). Then when the radio button is clicked call a javascript function that un-hides the correct drop down box. (you will have to ask a javascript expert if you want better details than that, I could probably get it to work, but not without gruelling hours of tiresome trial and error)

Trick 2: When the radio button is clicked, submit the form (<... onClick="this.form.submit()">) and then send them an exact duplicate of the form they had, but with everything that was filled out still filled out, and the appropriate drop down box made.

I've seen both of these methods done successfully, the first uses more javascript and loads a little slower (and seems to be less-well supported cross-browser), the second method uses more asp and needs to be re-loaded every time you click the radio button.

Jared
Jul 19 '07 #2
Matsam
33
Matsam,

You can't. But there are some tricks you can use to make it look like you do.

Trick 1: Open the db and make the three different versions of the drop-down box you could need, but hide them (<select ... style="visibility: hidden;">). Then when the radio button is clicked call a javascript function that un-hides the correct drop down box. (you will have to ask a javascript expert if you want better details than that, I could probably get it to work, but not without gruelling hours of tiresome trial and error)

Trick 2: When the radio button is clicked, submit the form (<... onClick="this.form.submit()">) and then send them an exact duplicate of the form they had, but with everything that was filled out still filled out, and the appropriate drop down box made.

I've seen both of these methods done successfully, the first uses more javascript and loads a little slower (and seems to be less-well supported cross-browser), the second method uses more asp and needs to be re-loaded every time you click the radio button.

Jared
Hi

Thanks for your help
I used the 2nd method, as I am not good in Javascripts
Thank you

Matsam
Jul 20 '07 #3

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

Similar topics

1
by: Brian | last post by:
Hello all... I have a page that will be performing a search. The search consists of 3 radio button options. The first 2 will search the entire web through google and the site as indexed by...
1
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there...
10
by: DettCom | last post by:
Hello, I would like to be able to display or hide fields based on whether a specific Yes/No radio button is selected. This is in conjunction with a posting a just made here in the same group...
4
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1>...
2
by: jimi_xyz | last post by:
Sorry if this isn't the correct group, i don't think there is a group for straight HTML. I am trying to create a type of search engine. There are two radio buttons at the top, in the middle there...
1
by: kenny8787 | last post by:
Hi, can anyone help here? I have the following code generated from a database, I want to have javascript calculate the costs of the selected items using radio buttons, subtotal the costs and...
1
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
10
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
8
by: photoboy | last post by:
I have racked by brain long enough on this, so now I need the help of someone who knows what they are doing. Here is what I am trying to achieve: First, I have two radio buttons (both unchecked)...
11
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.