Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Perl to enable/disable radio buttons 1

Status
Not open for further replies.

tsp120

Programmer
May 21, 2003
52
US
I am trying to create some functionality on my website. The page is written in Perl/CGI. I have a drop down box that gets loaded with values from a database. This works fine.

When a user selects an item from the dropdown box, I want the onSelect function to perform the following function:

-IF the option selected contains a certain string THEN enable a set of radio buttons on the page
-IF the option selected does not contain a certain string THEN disable a set of radio buttons on the page

I can easily create code in PERL to check for the string, and I can easily create javascript to enable and disable the radio buttons. However, I do not know the best way to merge the two. I'm hoping that maybe I can just call a Perl subroutine from the onSelect function, which will do the checking AND disable/enable the radio buttons.

If so, how can this be done. If not, what other options may I have?

Thanks!
 
Unless you're going to send the request back to the server for processing, you'll need to do this with Client-Side scripting.

- George
 
You can accomplish this using AJAX. Try searching for CGI::Ajax on CPAN. This will get the work done but Ajax will run only with new browser versions, so it depends on how badly you need it and where.

---
cheers!
san
smoking3vc.gif


print length "The answer to life, universe & everything!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top