Enable the one drop down at a time
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
I want to keep the one drop down active at a time in the form. When the page loads, one DD will be active and other will remain disabled. When I click on Disabled DD, it will get active while and the first DD which was enabled will turn to Disabled and vice a versa. So that user can submit the value for one DD only.
Can someone please help me with the code for this?
Below is the code I tried. I am calling this method on onblur and onfocus event of the DD component. However it doesn't work as expected.
Thanks
Amit
I want to keep the one drop down active at a time in the form. When the page loads, one DD will be active and other will remain disabled. When I click on Disabled DD, it will get active while and the first DD which was enabled will turn to Disabled and vice a versa. So that user can submit the value for one DD only.
Can someone please help me with the code for this?
Below is the code I tried. I am calling this method on onblur and onfocus event of the DD component. However it doesn't work as expected.
Thanks
Amit
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Amit,
Change your javascript function as under:
Hope this helps.
Thanks and Regards,
-------------------------------------------------------------------------------------
Komal Renu | [email protected] | www.infocepts.com
-------------------------------------------------------------------------------------
Change your javascript function as under:
Hope this helps.
Thanks and Regards,
-------------------------------------------------------------------------------------
Komal Renu | [email protected] | www.infocepts.com
-------------------------------------------------------------------------------------
Amitkumar Fulambarkar
Ranch Hand
Posts: 37
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Thanks for your reply Renu!
I had tried this option already. With the following code, when the page loads first time, both the DDs are enabled, that is fine. When I click one dropdown, other one get disabled. However, I also want it working working vice-versa.
It means if the user changes his mind to change the select option, he should be able to enable the disabled drop down and this time first DD will get disabled then.
So if we quick DD1, DD2 will disable. If we again click DD2, it will enable back and disable DD1.
Is it possible?
I had tried this option already. With the following code, when the page loads first time, both the DDs are enabled, that is fine. When I click one dropdown, other one get disabled. However, I also want it working working vice-versa.
It means if the user changes his mind to change the select option, he should be able to enable the disabled drop down and this time first DD will get disabled then.
So if we quick DD1, DD2 will disable. If we again click DD2, it will enable back and disable DD1.
Is it possible?
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
When the dropdown is disabled, how do you expect it to get focus? You can not focus it.
Eric
Eric
Komal Renu
Ranch Hand
Posts: 51
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Yes, what Eric says is correct and hence your javascript is not working.
I've created a small POC.
On page load, both multiboxes are enabled. The moment mouse moves over a particular multibox, the other one gets disbaled. This will work only for the first time when the page loads and both are enabled.
After that the user can click on the link to enable the corresponding multibox.
Here's the code
Try this out and do let me know if any additional help is required.
Thanks and Regards,
-------------------------------------------------------------------------------------
Komal Renu | [email protected] | www.infocepts.com
-------------------------------------------------------------------------------------
I've created a small POC.
On page load, both multiboxes are enabled. The moment mouse moves over a particular multibox, the other one gets disbaled. This will work only for the first time when the page loads and both are enabled.
After that the user can click on the link to enable the corresponding multibox.
Here's the code
Try this out and do let me know if any additional help is required.
Thanks and Regards,
-------------------------------------------------------------------------------------
Komal Renu | [email protected] | www.infocepts.com
-------------------------------------------------------------------------------------
Amitkumar Fulambarkar
Ranch Hand
Posts: 37
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
This is awesome Renu. This is working perfectly fine.
I was thinking not to add additional component to just handle the enable/disable logic, hence I didn't think in that direction. I was guessing if there is any way to execute the event on disabled component that I might not know. And this is the right forum to get the experts advice.
Thank you for your prompt help on this.
I was thinking not to add additional component to just handle the enable/disable logic, hence I didn't think in that direction. I was guessing if there is any way to execute the event on disabled component that I might not know. And this is the right forum to get the experts advice.
Thank you for your prompt help on this.
| Grow a forest with seedballs and this tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |






