Gossamer Forum
Home : Products : DBMan : Installation :

check box by default

Quote Reply
check box by default
How can I have a checkbox be checked by default?

------------------
thanks,
Chris
Quote Reply
Re: check box by default In reply to
Where ever you want to have your checkbox as default, just put "checked" in the html.pl. So it would look something like this:

<input type=checkbox checked>

Hope that helps.



------------------
Jason
Extreme mtb
http://extreme.nas.net
Quote Reply
Re: check box by default In reply to
Thanks for your reply. The checkbox I want to be checked by default is being built by the code for the search page in the sub html_record_form. It looks like this:
|; print &build_checkbox_field ("OppDir", "$rec{'OppDir'}"); print qq|
Where do I mark it checked? Your help is appreciated.

------------------
thanks,
Chris
Quote Reply
Re: check box by default In reply to
You can find that in the db.cgi under sub build_checkbox_field - just add "checked" to the input.


------------------
Jason
Extreme mtb
http://extreme.nas.net
Quote Reply
Re: check box by default In reply to
It should work if you set the field to the default value in the .cfg file and define your checkbox in %db_checkbox_fields.

To use the example in the .cfg file:

in %db_def =

Popular => [8, 'alpha', 0, 3, 0, 'Yes', ''],

and

%db_checkbox_fields = ( Popular => 'Yes' );

Hope this helps.


------------------
JPD