in reply to Re: How to handle multiple buttons inside CGI form
in thread How to handle multiple buttons inside CGI form

Thank you for your valuable suggestion. I implemented Radio Button group but one of the value is getting selected by default. Unless user select any choice, how can i deselect radio buttons without turning them on??

  • Comment on Re^2: How to handle multiple buttons inside CGI form

Replies are listed 'Best First'.
Re^3: How to handle multiple buttons inside CGI form
by GrandFather (Saint) on Feb 03, 2015 at 06:38 UTC

    Maybe provide an "opt out" button and make that the default so that that is an explicit option. After all, after the user has made a choice they can't go back to the original page state unless you provide an additional button.

    Perl is the programming world's equivalent of English
Re^3: How to handle multiple buttons inside CGI form
by silent11 (Vicar) on Feb 03, 2015 at 15:35 UTC
    Maybe this... http://perldoc.perl.org/CGI.html#PRAGMAS
    -nosticky By default the CGI module implements a state-preserving behavior called "sticky" fields. The way this works is that if you are regenerating a form, the methods that generate the form field values will interrogate param() to see if similarly-named parameters are present in the query string. If they find a like-named parameter, they will use it to set their default values. Sometimes this isn't what you want. The -nosticky pragma prevents this behavior. You can also selectively change the sticky behavior in each element that you generate.