473,761 Members | 10,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Only allow selection from select list when radio button clicked

254 Contributor
Hi

I have a html in which there is two selection box and two radio button. Radio buttion is of array type.

What I want if user will click the radio button then only he/she be able to make selection from select list. Initially I tried to disble the selection control. And when user will click the radio then only it was enabled. but I faced problem that value is not passed to the next form of the select list. so I enable the select list now it is working. but I want selection made only possible when user clicks the radio button.
Jan 25 '08 #1
10 3418
acoder
16,027 Recognized Expert Moderator MVP
Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

Moderator.
Jan 25 '08 #2
acoder
16,027 Recognized Expert Moderator MVP
I have a html in which there is two selection box and two radio button. Radio buttion is of array type.

What I want if user will click the radio button then only he/she be able to make selection from select list. Initially I tried to disble the selection control. And when user will click the radio then only it was enabled. but I faced problem that value is not passed to the next form of the select list. so I enable the select list now it is working. but I want selection made only possible when user clicks the radio button.
Instead of disabling the select element, set it to readonly.
Jan 25 '08 #3
mukeshrasm
254 Contributor
Instead of disabling the select element, set it to readonly.
Sorry for that!
I have given the html format of the page. I want selection made only possible if user selects first any of the radio buttion then he may able to select the from any select. Means If he clicks radio value having Static then User will select page from Static1 select if he checks radio with value Dynamic then he will select from Dynamic Select.

Expand|Select|Wrap|Line Numbers
  1.  html
  2. <input type="radio" value="Static" name="Static"  />
  3. <select name="Static1" id="select">
  4.         <option>Select Static Page </option>
  5.         <option>page 1</option>
  6. <option>page 2 </option>
  7.  
  8.             </select>
  9. <input type="radio" value="Static" name="Static"  />
  10. <select name="Dynamic" id="select" ">
  11.         <option>Select Static Page </option>
  12.         <option>page 1</option>
  13. <option>page 2 </option>
  14.  
  15.             </select>
Jan 25 '08 #4
acoder
16,027 Recognized Expert Moderator MVP
Instead of disabling the select element, set it to readonly.
Ignore this. I don't think the select element has a readOnly property.

What you can do is onsubmit re-enable the select elements.
Jan 25 '08 #5
mukeshrasm
254 Contributor
Ignore this. I don't think the select element has a readOnly property.

What you can do is onsubmit re-enable the select elements.
I tried to reenble the select onsubmit but its value is not going next in php.
Jan 28 '08 #6
acoder
16,027 Recognized Expert Moderator MVP
I tried to reenble the select onsubmit but its value is not going next in php.
Can you show the code that you tried.
Jan 28 '08 #7
mukeshrasm
254 Contributor
Can you show the code that you tried.
The problem is solved now.
Jan 29 '08 #8
acoder
16,027 Recognized Expert Moderator MVP
The problem is solved now.
Glad you managed to solve it. For the benefit of anyone else who comes across this thread, can you tell us what the problem/solution was.
Jan 29 '08 #9
mukeshrasm
254 Contributor
Glad you managed to solve it. For the benefit of anyone else who comes across this thread, can you tell us what the problem/solution was.
Actually option's value was empty. then I assign some value to it.
Expand|Select|Wrap|Line Numbers
  1.  
  2. <select>
  3. <option value="Page1">Page1</option>
  4. </select>
Jan 30 '08 #10

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

Similar topics

2
9206
by: /.. | last post by:
Hi all, I'm working on a report display page that currently uses 5 checkboxlists with a total of 86 items to display values from 5 different tables in an Access database. The page works fine now. On presenting it to the users they pointed out that their users could change the values in the checkboxes and then print them out, ultimately documenting false information.
8
2582
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and courses are populated. When course is selected, lists of occurrences, groups and
3
5949
by: David Hearn | last post by:
I have a datalist that I have inserted a radio button into. The datalist populates with a list of items and each one has a radio button next to it. I need to use the radio button to allow the user to select a default item so when the user clicks one of the radio buttons, it needs to clear the checked property from the rest. This is default behavior for the radio button, but it doesn't work when it is embedded into a datalist. I have tried...
0
1720
by: Jennifer | last post by:
I had this beautiful datagrid on an ASP page (VB.Net as the code behind). When I clicked on a Select Button, the row was selected and the background color changed the way it was supposed to. The SelectedIndexChanged event was called. It made me happy. Alas, I did something to my datagrid and rows were no longer being seleted. The SelectedIndexChanged event was ignored. Background colors did not change for the selected row. Not...
2
1537
by: slitchfield | last post by:
Sorry if this is real beginner's stuff, but I'm an old-school HTML guy and this is all another world to me. Is there an easy way to get the user to specify a number from 1 to 5 (in a pick list or radio button or similar) and get a javascript routine to multiply it by another hard-coded number (e.g. 7) and display the result further down the page? Thanks, Steve Litchfield
1
2979
by: Joe Attardi | last post by:
Hi all, On a form on one of my pages I have two <select> elements, and each one is paired up with a radio button. The idea is to choose an item from one list or the other and select the radio button of the list you want to use. I'm using JavaScript to automatically select the radio button corresponding to a list when you click on the list (using the onclick event handler). Is that the best event to change on, or should this
10
6694
by: Carlos | last post by:
Hi all, I have a form with an input radio control in a template field. When the user selects an option, and press a button the selection disappears.. I would like the selection to persist after the button makes the postback, I tried using the findcontrol but it returns null, and do not know how to make sure that the radio selected persist after the button action makes the postback.
10
18933
by: Bishman | last post by:
Hi, I need to programmatically allow or disallow the selection of multiple checkboxes on a form . At certain times I only want to allow a single selection, at other times I may wish to allow multiple. Is there a way of doing this ? I dont want to use Radio buttons..... Thanks,
0
10115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.