Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Marking "checkbox" html field checked

by stevieb (Canon)
on Sep 19, 2024 at 04:44 UTC ( [id://11161841]=note: print w/replies, xml ) Need Help??


in reply to Marking "checkbox" html field checked

Is there a common way or best practice, for creating a HTML "checkbox" form field

Yes. Use a templating system.

and marking it checked?

Yes. Use the templating system to pass the variable along, or use JavaScript/jQuery.

With that said, please, for the love of all things good, make sure this isn't an attempt to sucker someone into something that they then have to opt-out of. Any field that subscribes or commits someone to something should ALWAYS be unchecked by default. In such situations, default enabled is unscrupulous at best, and outright immoral and unethical (and more) at worst.

  • Comment on Re: Marking "checkbox" html field checked

Replies are listed 'Best First'.
Re^2: Marking "checkbox" html field checked
by Anonymous Monk on Sep 19, 2024 at 06:18 UTC
    should ALWAYS be unchecked by default

    ok... but we have no idea what this checkbox is for. Maybe it's to opt-in? Maybe it's to opt-out? Maybe it's to select which flavors of gummie the user wants?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11161841]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-10-08 23:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (44 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.