How set checkboxes to checked on new forms

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How set checkboxes to checked on new forms

Jolle Carlestam-2
Hello!

Long time no read. Been busy with non Lasso related stuff. But now  
I'm back at the keyboard again and thus all them questions pop up.

Here's one: I want a number of checkboxes in my form and that some of  
the values are preselected when displaying a new form. Can't get it  
to work. Any tips?

-default='selectMe', -value='selectMe' and -checked='selectMe' did  
not work.

HDB
Jolle

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How set checkboxes to checked on new forms

Johan Solve-2
Likewise...

-value is da trick. It must match the name side of the -options pair array.


At 14.43 +0200 2007-05-25, Jolle Carlestam wrote:

>Hello!
>
>Long time no read. Been busy with non Lasso related stuff. But now I'm back at the keyboard again and thus all them questions pop up.
>
>Here's one: I want a number of checkboxes in my form and that some of the values are preselected when displaying a new form. Can't get it to work. Any tips?
>
>-default='selectMe', -value='selectMe' and -checked='selectMe' did not work.
>
>HDB
>Jolle
>
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email]>.
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>List archive http://lists.montania.se/Lists/knop/
>(log in with your email and ConfirmationID as password, send message to
><[hidden email]> to get that ID)
>Project homepage http://montania.se/projects/knop/
>AIM chatroom knop aim:gochat?roomname=knop


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How set checkboxes to checked on new forms

Jolle Carlestam-2
Sidenote;
  Strange I got your reply before I got my original message back.  
Still not in my inbox as a matter of fact.
/Sidenote;

-value makes no magic in my corner.

Here's some code snippets:

cfg doc
        $f -> (addfield:
                        -type='checkbox',
                        -name='group',
                        -label='Grupp',
                        -options=$options,
                        -value = 'Granskare',
                        -linebreak,
                        -raw='style="width: 200px"');

lib doc
        $options = (array: -optgroup='Grupp avgör användarens rättigheter',  
'Redaktör'='Redaktör', 'Granskare'='Granskare', 'Admin'='Admin');


Result
Grupp avgör användarens rättigheter<br>
<input type="checkbox" name="group" id="form2_group7_2" style="width:  
200px" value="Redakt&ouml;r" onclick="makedirty();"> <label  
for="form2_group7_2" onclick="makedirty();togglecontrol(getElementById
('form2_group7_2'));return false;">Redaktör</label> <br>
<input type="checkbox" name="group" id="form2_group7_3" style="width:  
200px" value="Granskare" onclick="makedirty();"> <label  
for="form2_group7_3" onclick="makedirty();togglecontrol(getElementById
('form2_group7_3'));return false;">Granskare</label> <br>
<input type="checkbox" name="group" id="form2_group7_4" style="width:  
200px" value="Admin" onclick="makedirty();"> <label  
for="form2_group7_4" onclick="makedirty();togglecontrol(getElementById
('form2_group7_4'));return false;">Admin</label> </div>
<br>

HDB
Jolle

25 maj 2007 kl. 14.49 skrev Johan Solve:

> Likewise...
>
> -value is da trick. It must match the name side of the -options  
> pair array.
>
>
> At 14.43 +0200 2007-05-25, Jolle Carlestam wrote:
>> Hello!
>>
>> Long time no read. Been busy with non Lasso related stuff. But now  
>> I'm back at the keyboard again and thus all them questions pop up.
>>
>> Here's one: I want a number of checkboxes in my form and that some  
>> of the values are preselected when displaying a new form. Can't  
>> get it to work. Any tips?
>>
>> -default='selectMe', -value='selectMe' and -checked='selectMe' did  
>> not work.
>>
>> HDB
>> Jolle
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>> List archive http://lists.montania.se/Lists/knop/
>> (log in with your email and ConfirmationID as password, send  
>> message to
>> <[hidden email]> to get that ID)
>> Project homepage http://montania.se/projects/knop/
>> AIM chatroom knop aim:gochat?roomname=knop
>
>
> --
>      Johan Sölve    [FSA Member, Lasso Partner]
>      Web Application/Lasso/FileMaker Developer
>      MONTANIA SOFTWARE & SOLUTIONS
> http://www.montania.se   mailto:[hidden email]
>  (spam-safe email address, replace '-' with 'a')
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
> List archive http://lists.montania.se/Lists/knop/
> (log in with your email and ConfirmationID as password, send  
> message to
> <[hidden email]> to get that ID)
> Project homepage http://montania.se/projects/knop/
> AIM chatroom knop aim:gochat?roomname=knop


#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How set checkboxes to checked on new forms

Jolle Carlestam-2
Actually it turns out that I get a value if I look at an existing  
record. But if I call the form for the purpose of adding a new record  
it's empty. The checkbox is not attached to a real DB field so it's  
kinda funny that I get a value selected when showing an record that  
doesn't have any field connected to the checkbox but not when I call  
a new form.

HDB
Jolle

pst I know that the one who could answer this probably is taking his  
well earned weekend off, spending time with his family. I'm in no  
hurry. This can wait until next week. :-)


25 maj 2007 kl. 14.56 skrev Jolle Carlestam:

> -value makes no magic in my corner.


#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How set checkboxes to checked on new forms

Johan Solve-2
At 16.23 +0200 2007-05-25, Jolle Carlestam wrote:
>Actually it turns out that I get a value if I look at an existing record. But if I call the form for the purpose of adding a new record it's empty. The checkbox is not attached to a real DB field so it's kinda funny that I get a value selected when showing an record that doesn't have any field connected to the checkbox but not when I call a new form.

You probably run ->loadfields (from non-existent form input) after cfg, and thus the default value is overridden by the (non-existent i.e. empty) form submission.
Put loadfields in a conditional so it doesn't fire unless you have a form submission (and in that case loadfields happens in act) or if you pull record from db.


>pst I know that the one who could answer this probably is taking his well earned weekend off, spending time with his family. I'm in no hurry. This can wait until next week. :-)

Bah. Appreciate the thought but I'm not the offline type. :-)
Just had some fun with a rented skylift - about to do some paintwork on the house tomorrow.


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How set checkboxes to checked on new forms

Jolle Carlestam-2
25 maj 2007 kl. 21.09 skrev Johan Solve:

>> pst I know that the one who could answer this probably is taking  
>> his well earned weekend off, spending time with his family. I'm in  
>> no hurry. This can wait until next week. :-)
>
> Bah. Appreciate the thought but I'm not the offline type. :-)
> Just had some fun with a rented skylift - about to do some  
> paintwork on the house tomorrow.

Send the skylift my way when you're finished. Have a barn to paint.  
After I finished building the new chicken house that is... :-)

HDB
Jolle

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop


Loading...