Update Form and Checkboxes

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Update Form and Checkboxes

kimonostereo
Hi all,

I have result data that I'm trying to update. One of the fields is a checkbox. I can show the result data, but I'm not sure how to handle the lasso syntax if the user unchecks the item.

<input type="checkbox" name="primary_lives_with" [if: (field: 'primary_lives_with') =='yes'] value="yes"
checked="checked"[/if] />

How can I get the unchecked data sent back on submission?

\\scott\\
#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

Israel Thompson
Hi Scott,

Since the checkbox is either on or off, the value doesn't need to be
inside of the conditional statement. So:

<input type="checkbox" name="primary_lives_with" value="yes"
[field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
On the receiving page, just look for
action_param('primary_lives_with') == 'yes'. If you have to have a
value for the checkbox, whether it's checked or not, you could set a
simple conditional on the receiving page like so:

action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
= 'yes') | var('primary_lives_with' = 'no');

Hope this helps.

Sincerely,

Israel Thompson


On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]> wrote:

> Hi all,
>
> I have result data that I'm trying to update. One of the fields is a checkbox. I can show the result data, but I'm not sure how to handle the lasso syntax if the user unchecks the item.
>
> <input type="checkbox" name="primary_lives_with" [if: (field: 'primary_lives_with') =='yes'] value="yes"
> checked="checked"[/if] />
>
> How can I get the unchecked data sent back on submission?
>
> \\scott\\
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

kimonostereo
Hi Israel,

Thanks for your help on this.

Sorry for the silly question but....

For this snippet of code:
> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
> = 'yes') | var('primary_lives_with' = 'no');

Do I put that in the inline of the receiving page or ?
Been trying to work with it for the last few hours but haven't gotten far.

thanks
\\scott\\

On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:

> Hi Scott,
>
> Since the checkbox is either on or off, the value doesn't need to be
> inside of the conditional statement. So:
>
> <input type="checkbox" name="primary_lives_with" value="yes"
> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
> On the receiving page, just look for
> action_param('primary_lives_with') == 'yes'. If you have to have a
> value for the checkbox, whether it's checked or not, you could set a
> simple conditional on the receiving page like so:
>
> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
> = 'yes') | var('primary_lives_with' = 'no');
>
> Hope this helps.
>
> Sincerely,
>
> Israel Thompson
>
>
> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]> wrote:
>> Hi all,
>>
>> I have result data that I'm trying to update. One of the fields is a checkbox. I can show the result data, but I'm not sure how to handle the lasso syntax if the user unchecks the item.
>>
>> <input type="checkbox" name="primary_lives_with" [if: (field: 'primary_lives_with') =='yes'] value="yes"
>> checked="checked"[/if] />
>>
>> How can I get the unchecked data sent back on submission?
>>
>> \\scott\\
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

Israel Thompson
Yes.. on the receiving page, but somewhere near the top before any
inlines would work best.

[action_param('primary_lives_with') == 'yes' ?
var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]

This will define the $primary_lives_with page variable that can be
utilized anywhere on the receiving page below the line above, so you'd
want to reference the var instead of the action_param thereafter.

Izz


On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:

> Hi Israel,
>
> Thanks for your help on this.
>
> Sorry for the silly question but....
>
> For this snippet of code:
>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>> = 'yes') | var('primary_lives_with' = 'no');
>
> Do I put that in the inline of the receiving page or ?
> Been trying to work with it for the last few hours but haven't gotten far.
>
> thanks
> \\scott\\
>
> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>
>> Hi Scott,
>>
>> Since the checkbox is either on or off, the value doesn't need to be
>> inside of the conditional statement. So:
>>
>> <input type="checkbox" name="primary_lives_with" value="yes"
>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>> On the receiving page, just look for
>> action_param('primary_lives_with') == 'yes'. If you have to have a
>> value for the checkbox, whether it's checked or not, you could set a
>> simple conditional on the receiving page like so:
>>
>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>> = 'yes') | var('primary_lives_with' = 'no');
>>
>> Hope this helps.
>>
>> Sincerely,
>>
>> Israel Thompson
>>
>>
>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]> wrote:
>>> Hi all,
>>>
>>> I have result data that I'm trying to update. One of the fields is a checkbox. I can show the result data, but I'm not sure how to handle the lasso syntax if the user unchecks the item.
>>>
>>> <input type="checkbox" name="primary_lives_with" [if: (field: 'primary_lives_with') =='yes'] value="yes"
>>> checked="checked"[/if] />
>>>
>>> How can I get the unchecked data sent back on submission?
>>>
>>> \\scott\\
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

Steffan A. Cline
An even shorter way of doing this is:

var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
'yes' | 'no');

Ok, just a tad shorter but is more inline with mainstream programming
since most don't allow complex statements like Izzy did. :~)

I know there is an even shorter way that escapes me at the moment...


Thanks

Steffan

---------------------------------------------------------------
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline  
[hidden email]                             Phoenix, Az
http://www.ExecuChoice.net                                  USA
AIM : SteffanC          ICQ : 57234309
YAHOO : Steffan_Cline   MSN : [hidden email]
GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
---------------------------------------------------------------





On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:

>Yes.. on the receiving page, but somewhere near the top before any
>inlines would work best.
>
>[action_param('primary_lives_with') == 'yes' ?
>var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>
>This will define the $primary_lives_with page variable that can be
>utilized anywhere on the receiving page below the line above, so you'd
>want to reference the var instead of the action_param thereafter.
>
>Izz
>
>
>On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>> Hi Israel,
>>
>> Thanks for your help on this.
>>
>> Sorry for the silly question but....
>>
>> For this snippet of code:
>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>> = 'yes') | var('primary_lives_with' = 'no');
>>
>> Do I put that in the inline of the receiving page or ?
>> Been trying to work with it for the last few hours but haven't gotten
>>far.
>>
>> thanks
>> \\scott\\
>>
>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>
>>> Hi Scott,
>>>
>>> Since the checkbox is either on or off, the value doesn't need to be
>>> inside of the conditional statement. So:
>>>
>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>> On the receiving page, just look for
>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>> value for the checkbox, whether it's checked or not, you could set a
>>> simple conditional on the receiving page like so:
>>>
>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>> = 'yes') | var('primary_lives_with' = 'no');
>>>
>>> Hope this helps.
>>>
>>> Sincerely,
>>>
>>> Israel Thompson
>>>
>>>
>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>wrote:
>>>> Hi all,
>>>>
>>>> I have result data that I'm trying to update. One of the fields is a
>>>>checkbox. I can show the result data, but I'm not sure how to handle
>>>>the lasso syntax if the user unchecks the item.
>>>>
>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>'primary_lives_with') =='yes'] value="yes"
>>>> checked="checked"[/if] />
>>>>
>>>> How can I get the unchecked data sent back on submission?
>>>>
>>>> \\scott\\
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>>  the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to
>>>><[hidden email]>
>>>> To switch to the INDEX mode, E-mail to
>>>><[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to
>>><[hidden email]>
>>> To switch to the INDEX mode, E-mail to
>>><[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to
>><[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>>
>
>#############################################################
>This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
>To unsubscribe, E-mail to: <[hidden email]>
>To switch to the DIGEST mode, E-mail to <[hidden email]>
>To switch to the INDEX mode, E-mail to <[hidden email]>
>Send administrative queries to  <[hidden email]>
>



#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

kimonostereo
In reply to this post by Israel Thompson
Ah! Now it works!

It's a pain, but I suppose I will have to do this for all the checkboxes in this update form.

Thank you for showing me how it's done.

A lot harder than a pull down menu for sure, but at least I know how to do it now!

Mahalo!
\\scott\\


On Oct 15, 2010, at 10:14 AM, Israel Thompson wrote:

> Yes.. on the receiving page, but somewhere near the top before any
> inlines would work best.
>
> [action_param('primary_lives_with') == 'yes' ?
> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>
> This will define the $primary_lives_with page variable that can be
> utilized anywhere on the receiving page below the line above, so you'd
> want to reference the var instead of the action_param thereafter.
>
> Izz
>
>
> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>> Hi Israel,
>>
>> Thanks for your help on this.
>>
>> Sorry for the silly question but....
>>
>> For this snippet of code:
>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>> = 'yes') | var('primary_lives_with' = 'no');
>>
>> Do I put that in the inline of the receiving page or ?
>> Been trying to work with it for the last few hours but haven't gotten far.
>>
>> thanks
>> \\scott\\
>>
>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>
>>> Hi Scott,
>>>
>>> Since the checkbox is either on or off, the value doesn't need to be
>>> inside of the conditional statement. So:
>>>
>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>> On the receiving page, just look for
>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>> value for the checkbox, whether it's checked or not, you could set a
>>> simple conditional on the receiving page like so:
>>>
>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>> = 'yes') | var('primary_lives_with' = 'no');
>>>
>>> Hope this helps.
>>>
>>> Sincerely,
>>>
>>> Israel Thompson
>>>
>>>
>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>> Hi all,
>>>>
>>>> I have result data that I'm trying to update. One of the fields is a checkbox. I can show the result data, but I'm not sure how to handle the lasso syntax if the user unchecks the item.
>>>>
>>>> <input type="checkbox" name="primary_lives_with" [if: (field: 'primary_lives_with') =='yes'] value="yes"
>>>> checked="checked"[/if] />
>>>>
>>>> How can I get the unchecked data sent back on submission?
>>>>
>>>> \\scott\\
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>>  the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

Israel Thompson
In reply to this post by Steffan A. Cline
Ahh.. yes.. Slaps self for not writing it that way!

Izz


On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:

> An even shorter way of doing this is:
>
> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
> 'yes' | 'no');
>
> Ok, just a tad shorter but is more inline with mainstream programming
> since most don't allow complex statements like Izzy did. :~)
>
> I know there is an even shorter way that escapes me at the moment...
>
>
> Thanks
>
> Steffan
>
> ---------------------------------------------------------------
> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
> Steffan A. Cline
> [hidden email]                             Phoenix, Az
> http://www.ExecuChoice.net                                  USA
> AIM : SteffanC          ICQ : 57234309
> YAHOO : Steffan_Cline   MSN : [hidden email]
> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
> ---------------------------------------------------------------
>
>
>
>
>
> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>
>>Yes.. on the receiving page, but somewhere near the top before any
>>inlines would work best.
>>
>>[action_param('primary_lives_with') == 'yes' ?
>>var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>
>>This will define the $primary_lives_with page variable that can be
>>utilized anywhere on the receiving page below the line above, so you'd
>>want to reference the var instead of the action_param thereafter.
>>
>>Izz
>>
>>
>>On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>> Hi Israel,
>>>
>>> Thanks for your help on this.
>>>
>>> Sorry for the silly question but....
>>>
>>> For this snippet of code:
>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>
>>> Do I put that in the inline of the receiving page or ?
>>> Been trying to work with it for the last few hours but haven't gotten
>>>far.
>>>
>>> thanks
>>> \\scott\\
>>>
>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>
>>>> Hi Scott,
>>>>
>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>> inside of the conditional statement. So:
>>>>
>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>> On the receiving page, just look for
>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>> value for the checkbox, whether it's checked or not, you could set a
>>>> simple conditional on the receiving page like so:
>>>>
>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>
>>>> Hope this helps.
>>>>
>>>> Sincerely,
>>>>
>>>> Israel Thompson
>>>>
>>>>
>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>wrote:
>>>>> Hi all,
>>>>>
>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>checkbox. I can show the result data, but I'm not sure how to handle
>>>>>the lasso syntax if the user unchecks the item.
>>>>>
>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>'primary_lives_with') =='yes'] value="yes"
>>>>> checked="checked"[/if] />
>>>>>
>>>>> How can I get the unchecked data sent back on submission?
>>>>>
>>>>> \\scott\\
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>>  the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to
>>>>><[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to
>>>>><[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>>  the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to
>>>><[hidden email]>
>>>> To switch to the INDEX mode, E-mail to
>>>><[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to
>>><[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>
>>#############################################################
>>This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>>To unsubscribe, E-mail to: <[hidden email]>
>>To switch to the DIGEST mode, E-mail to <[hidden email]>
>>To switch to the INDEX mode, E-mail to <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>>
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

kimonostereo
Ah! One issue came up.

If the primary_lives_with box is unchecked to start, then it's checked, I'm now seeing "yes yes" input into the db instead of just "yes".

Any ideas?


On Oct 15, 2010, at 10:33 AM, Israel Thompson wrote:

> Ahh.. yes.. Slaps self for not writing it that way!
>
> Izz
>
>
> On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:
>> An even shorter way of doing this is:
>>
>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
>> 'yes' | 'no');
>>
>> Ok, just a tad shorter but is more inline with mainstream programming
>> since most don't allow complex statements like Izzy did. :~)
>>
>> I know there is an even shorter way that escapes me at the moment...
>>
>>
>> Thanks
>>
>> Steffan
>>
>> ---------------------------------------------------------------
>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>> Steffan A. Cline
>> [hidden email]                             Phoenix, Az
>> http://www.ExecuChoice.net                                  USA
>> AIM : SteffanC          ICQ : 57234309
>> YAHOO : Steffan_Cline   MSN : [hidden email]
>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>> ---------------------------------------------------------------
>>
>>
>>
>>
>>
>> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>>
>>> Yes.. on the receiving page, but somewhere near the top before any
>>> inlines would work best.
>>>
>>> [action_param('primary_lives_with') == 'yes' ?
>>> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>>
>>> This will define the $primary_lives_with page variable that can be
>>> utilized anywhere on the receiving page below the line above, so you'd
>>> want to reference the var instead of the action_param thereafter.
>>>
>>> Izz
>>>
>>>
>>> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>> Hi Israel,
>>>>
>>>> Thanks for your help on this.
>>>>
>>>> Sorry for the silly question but....
>>>>
>>>> For this snippet of code:
>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>
>>>> Do I put that in the inline of the receiving page or ?
>>>> Been trying to work with it for the last few hours but haven't gotten
>>>> far.
>>>>
>>>> thanks
>>>> \\scott\\
>>>>
>>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>>
>>>>> Hi Scott,
>>>>>
>>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>>> inside of the conditional statement. So:
>>>>>
>>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>> On the receiving page, just look for
>>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>>> value for the checkbox, whether it's checked or not, you could set a
>>>>> simple conditional on the receiving page like so:
>>>>>
>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>
>>>>> Hope this helps.
>>>>>
>>>>> Sincerely,
>>>>>
>>>>> Israel Thompson
>>>>>
>>>>>
>>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>> wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>> checkbox. I can show the result data, but I'm not sure how to handle
>>>>>> the lasso syntax if the user unchecks the item.
>>>>>>
>>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>> 'primary_lives_with') =='yes'] value="yes"
>>>>>> checked="checked"[/if] />
>>>>>>
>>>>>> How can I get the unchecked data sent back on submission?
>>>>>>
>>>>>> \\scott\\
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>>  the mailing list <[hidden email]>.
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>> <[hidden email]>
>>>>>> To switch to the INDEX mode, E-mail to
>>>>>> <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>>  the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to
>>>>> <[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to
>>>>> <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>>  the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to
>>>> <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

Israel Thompson
Make sure the primary_live_with_box is only being submitted once and
that the value="yes". Also, make sure to use the var
$primary_live_with_box instead of action_param when inserting into the
inline query. To test, try outputting
action_param('primary_live_with_box') at the top of your receiving
page with an abort thereafter to see what's coming across. If it
outputs just a single "yes", the duplicate is occurring further down
in the receiving page.

Izz


On Fri, Oct 15, 2010 at 3:40 PM, Scott Yoshinaga <[hidden email]> wrote:

> Ah! One issue came up.
>
> If the primary_lives_with box is unchecked to start, then it's checked, I'm now seeing "yes yes" input into the db instead of just "yes".
>
> Any ideas?
>
>
> On Oct 15, 2010, at 10:33 AM, Israel Thompson wrote:
>
>> Ahh.. yes.. Slaps self for not writing it that way!
>>
>> Izz
>>
>>
>> On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:
>>> An even shorter way of doing this is:
>>>
>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
>>> 'yes' | 'no');
>>>
>>> Ok, just a tad shorter but is more inline with mainstream programming
>>> since most don't allow complex statements like Izzy did. :~)
>>>
>>> I know there is an even shorter way that escapes me at the moment...
>>>
>>>
>>> Thanks
>>>
>>> Steffan
>>>
>>> ---------------------------------------------------------------
>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>> Steffan A. Cline
>>> [hidden email]                             Phoenix, Az
>>> http://www.ExecuChoice.net                                  USA
>>> AIM : SteffanC          ICQ : 57234309
>>> YAHOO : Steffan_Cline   MSN : [hidden email]
>>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>>> ---------------------------------------------------------------
>>>
>>>
>>>
>>>
>>>
>>> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>>>
>>>> Yes.. on the receiving page, but somewhere near the top before any
>>>> inlines would work best.
>>>>
>>>> [action_param('primary_lives_with') == 'yes' ?
>>>> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>>>
>>>> This will define the $primary_lives_with page variable that can be
>>>> utilized anywhere on the receiving page below the line above, so you'd
>>>> want to reference the var instead of the action_param thereafter.
>>>>
>>>> Izz
>>>>
>>>>
>>>> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>> Hi Israel,
>>>>>
>>>>> Thanks for your help on this.
>>>>>
>>>>> Sorry for the silly question but....
>>>>>
>>>>> For this snippet of code:
>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>
>>>>> Do I put that in the inline of the receiving page or ?
>>>>> Been trying to work with it for the last few hours but haven't gotten
>>>>> far.
>>>>>
>>>>> thanks
>>>>> \\scott\\
>>>>>
>>>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>>>
>>>>>> Hi Scott,
>>>>>>
>>>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>>>> inside of the conditional statement. So:
>>>>>>
>>>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>>> On the receiving page, just look for
>>>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>>>> value for the checkbox, whether it's checked or not, you could set a
>>>>>> simple conditional on the receiving page like so:
>>>>>>
>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>
>>>>>> Hope this helps.
>>>>>>
>>>>>> Sincerely,
>>>>>>
>>>>>> Israel Thompson
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>>> wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>>> checkbox. I can show the result data, but I'm not sure how to handle
>>>>>>> the lasso syntax if the user unchecks the item.
>>>>>>>
>>>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>>> 'primary_lives_with') =='yes'] value="yes"
>>>>>>> checked="checked"[/if] />
>>>>>>>
>>>>>>> How can I get the unchecked data sent back on submission?
>>>>>>>
>>>>>>> \\scott\\
>>>>>>> #############################################################
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>  the mailing list <[hidden email]>.
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>> <[hidden email]>
>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>> <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>>  the mailing list <[hidden email]>.
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>> <[hidden email]>
>>>>>> To switch to the INDEX mode, E-mail to
>>>>>> <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>>  the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to
>>>>> <[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>>  the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

kimonostereo
I think I figured out why double inputting "yes" but not sure how to stop it.

On my form response page I have this:

<input type="checkbox" name="primary_lives_with" value="yes" [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />

Then on the update page I have this:

var('primary_lives_with' = action_param('primary_lives_with') == 'yes' ?
'yes' | 'no');

[Inline: (Action_Params),
-Database='ms-hs-forms',
-Table='table',
'primary_lives_with'=($primary_lives_with),
$Action]

Maybe I need some logic in the inline to not double post?



On Oct 15, 2010, at 10:56 AM, Israel Thompson wrote:

> Make sure the primary_live_with_box is only being submitted once and
> that the value="yes". Also, make sure to use the var
> $primary_live_with_box instead of action_param when inserting into the
> inline query. To test, try outputting
> action_param('primary_live_with_box') at the top of your receiving
> page with an abort thereafter to see what's coming across. If it
> outputs just a single "yes", the duplicate is occurring further down
> in the receiving page.
>
> Izz
>
>
> On Fri, Oct 15, 2010 at 3:40 PM, Scott Yoshinaga <[hidden email]> wrote:
>> Ah! One issue came up.
>>
>> If the primary_lives_with box is unchecked to start, then it's checked, I'm now seeing "yes yes" input into the db instead of just "yes".
>>
>> Any ideas?
>>
>>
>> On Oct 15, 2010, at 10:33 AM, Israel Thompson wrote:
>>
>>> Ahh.. yes.. Slaps self for not writing it that way!
>>>
>>> Izz
>>>
>>>
>>> On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:
>>>> An even shorter way of doing this is:
>>>>
>>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
>>>> 'yes' | 'no');
>>>>
>>>> Ok, just a tad shorter but is more inline with mainstream programming
>>>> since most don't allow complex statements like Izzy did. :~)
>>>>
>>>> I know there is an even shorter way that escapes me at the moment...
>>>>
>>>>
>>>> Thanks
>>>>
>>>> Steffan
>>>>
>>>> ---------------------------------------------------------------
>>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>>> Steffan A. Cline
>>>> [hidden email]                             Phoenix, Az
>>>> http://www.ExecuChoice.net                                  USA
>>>> AIM : SteffanC          ICQ : 57234309
>>>> YAHOO : Steffan_Cline   MSN : [hidden email]
>>>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>>>> ---------------------------------------------------------------
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>>>>
>>>>> Yes.. on the receiving page, but somewhere near the top before any
>>>>> inlines would work best.
>>>>>
>>>>> [action_param('primary_lives_with') == 'yes' ?
>>>>> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>>>>
>>>>> This will define the $primary_lives_with page variable that can be
>>>>> utilized anywhere on the receiving page below the line above, so you'd
>>>>> want to reference the var instead of the action_param thereafter.
>>>>>
>>>>> Izz
>>>>>
>>>>>
>>>>> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>>> Hi Israel,
>>>>>>
>>>>>> Thanks for your help on this.
>>>>>>
>>>>>> Sorry for the silly question but....
>>>>>>
>>>>>> For this snippet of code:
>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>
>>>>>> Do I put that in the inline of the receiving page or ?
>>>>>> Been trying to work with it for the last few hours but haven't gotten
>>>>>> far.
>>>>>>
>>>>>> thanks
>>>>>> \\scott\\
>>>>>>
>>>>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>>>>
>>>>>>> Hi Scott,
>>>>>>>
>>>>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>>>>> inside of the conditional statement. So:
>>>>>>>
>>>>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>>>> On the receiving page, just look for
>>>>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>>>>> value for the checkbox, whether it's checked or not, you could set a
>>>>>>> simple conditional on the receiving page like so:
>>>>>>>
>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>
>>>>>>> Hope this helps.
>>>>>>>
>>>>>>> Sincerely,
>>>>>>>
>>>>>>> Israel Thompson
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>>>> wrote:
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>>>> checkbox. I can show the result data, but I'm not sure how to handle
>>>>>>>> the lasso syntax if the user unchecks the item.
>>>>>>>>
>>>>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>>>> 'primary_lives_with') =='yes'] value="yes"
>>>>>>>> checked="checked"[/if] />
>>>>>>>>
>>>>>>>> How can I get the unchecked data sent back on submission?
>>>>>>>>
>>>>>>>> \\scott\\
>>>>>>>> #############################################################
>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>  the mailing list <[hidden email]>.
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>> <[hidden email]>
>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>> <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> #############################################################
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>  the mailing list <[hidden email]>.
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>> <[hidden email]>
>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>> <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>>  the mailing list <[hidden email]>.
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>> <[hidden email]>
>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>>  the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>>  the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

Israel Thompson
On the update page, after you define the var, but before the try:

$primary_lives_with; abort;

What does that output?

If the output is as desired, remove it and focus on your inline below. Assuming this is a MySQL db, you could write it as follows:

inline(
    -database='ms-hs-forms',
    -table='table',
    -statementonly,
    -sql='update table set primary_lives_with = "' + $primary_lives_with + '" where id = ' + $id
    );
    action_statement; error_currenterror; abort;
/inline;

Tell us what that outputs. And if you aren't running MySQL, what are you running?

Also, I seem to remember some users experiencing issues with db and tbl names containing dashes, so you might want to look into that... On mobile ATM and don't know exactly where the article or thread was.

Izz


On Oct 15, 2010, at 5:13 PM, Scott Yoshinaga <[hidden email]> wrote:

> I think I figured out why double inputting "yes" but not sure how to stop it.
>
> On my form response page I have this:
>
> <input type="checkbox" name="primary_lives_with" value="yes" [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>
> Then on the update page I have this:
>
> var('primary_lives_with' = action_param('primary_lives_with') == 'yes' ?
> 'yes' | 'no');
>
> [Inline: (Action_Params),
> -Database='ms-hs-forms',
> -Table='table',
> 'primary_lives_with'=($primary_lives_with),
> $Action]    
>
> Maybe I need some logic in the inline to not double post?
>
>
>
> On Oct 15, 2010, at 10:56 AM, Israel Thompson wrote:
>
>> Make sure the primary_live_with_box is only being submitted once and
>> that the value="yes". Also, make sure to use the var
>> $primary_live_with_box instead of action_param when inserting into the
>> inline query. To test, try outputting
>> action_param('primary_live_with_box') at the top of your receiving
>> page with an abort thereafter to see what's coming across. If it
>> outputs just a single "yes", the duplicate is occurring further down
>> in the receiving page.
>>
>> Izz
>>
>>
>> On Fri, Oct 15, 2010 at 3:40 PM, Scott Yoshinaga <[hidden email]> wrote:
>>> Ah! One issue came up.
>>>
>>> If the primary_lives_with box is unchecked to start, then it's checked, I'm now seeing "yes yes" input into the db instead of just "yes".
>>>
>>> Any ideas?
>>>
>>>
>>> On Oct 15, 2010, at 10:33 AM, Israel Thompson wrote:
>>>
>>>> Ahh.. yes.. Slaps self for not writing it that way!
>>>>
>>>> Izz
>>>>
>>>>
>>>> On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:
>>>>> An even shorter way of doing this is:
>>>>>
>>>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
>>>>> 'yes' | 'no');
>>>>>
>>>>> Ok, just a tad shorter but is more inline with mainstream programming
>>>>> since most don't allow complex statements like Izzy did. :~)
>>>>>
>>>>> I know there is an even shorter way that escapes me at the moment...
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> Steffan
>>>>>
>>>>> ---------------------------------------------------------------
>>>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>>>> Steffan A. Cline
>>>>> [hidden email]                             Phoenix, Az
>>>>> http://www.ExecuChoice.net                                  USA
>>>>> AIM : SteffanC          ICQ : 57234309
>>>>> YAHOO : Steffan_Cline   MSN : [hidden email]
>>>>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>>>>> ---------------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>>>>>
>>>>>> Yes.. on the receiving page, but somewhere near the top before any
>>>>>> inlines would work best.
>>>>>>
>>>>>> [action_param('primary_lives_with') == 'yes' ?
>>>>>> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>>>>>
>>>>>> This will define the $primary_lives_with page variable that can be
>>>>>> utilized anywhere on the receiving page below the line above, so you'd
>>>>>> want to reference the var instead of the action_param thereafter.
>>>>>>
>>>>>> Izz
>>>>>>
>>>>>>
>>>>>> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>>>> Hi Israel,
>>>>>>>
>>>>>>> Thanks for your help on this.
>>>>>>>
>>>>>>> Sorry for the silly question but....
>>>>>>>
>>>>>>> For this snippet of code:
>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>
>>>>>>> Do I put that in the inline of the receiving page or ?
>>>>>>> Been trying to work with it for the last few hours but haven't gotten
>>>>>>> far.
>>>>>>>
>>>>>>> thanks
>>>>>>> \\scott\\
>>>>>>>
>>>>>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>>>>>
>>>>>>>> Hi Scott,
>>>>>>>>
>>>>>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>>>>>> inside of the conditional statement. So:
>>>>>>>>
>>>>>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>>>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>>>>> On the receiving page, just look for
>>>>>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>>>>>> value for the checkbox, whether it's checked or not, you could set a
>>>>>>>> simple conditional on the receiving page like so:
>>>>>>>>
>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>
>>>>>>>> Hope this helps.
>>>>>>>>
>>>>>>>> Sincerely,
>>>>>>>>
>>>>>>>> Israel Thompson
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>>>>> wrote:
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>>>>> checkbox. I can show the result data, but I'm not sure how to handle
>>>>>>>>> the lasso syntax if the user unchecks the item.
>>>>>>>>>
>>>>>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>>>>> 'primary_lives_with') =='yes'] value="yes"
>>>>>>>>> checked="checked"[/if] />
>>>>>>>>>
>>>>>>>>> How can I get the unchecked data sent back on submission?
>>>>>>>>>
>>>>>>>>> \\scott\\
>>>>>>>>> #############################################################
>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>> <[hidden email]>
>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>> <[hidden email]>
>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> #############################################################
>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>> <[hidden email]>
>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>> <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> #############################################################
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>> the mailing list <[hidden email]>.
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>> <[hidden email]>
>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list <[hidden email]>.
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

kimonostereo
Okay, added the $primary_lives_with;abort;
If I leave the box checked, I get:
yes

if I uncheck the box, I get an error:
Page variable "primary_lives_with" not found

I'm using FM SA10 as the database.

thanks for your help!
\\scott\\

On Oct 15, 2010, at 12:56 PM, Israel Thompson wrote:

> On the update page, after you define the var, but before the try:
>
> $primary_lives_with; abort;
>
> What does that output?
>
> If the output is as desired, remove it and focus on your inline below. Assuming this is a MySQL db, you could write it as follows:
>
> inline(
>    -database='ms-hs-forms',
>    -table='table',
>    -statementonly,
>    -sql='update table set primary_lives_with = "' + $primary_lives_with + '" where id = ' + $id
>    );
>    action_statement; error_currenterror; abort;
> /inline;
>
> Tell us what that outputs. And if you aren't running MySQL, what are you running?
>
> Also, I seem to remember some users experiencing issues with db and tbl names containing dashes, so you might want to look into that... On mobile ATM and don't know exactly where the article or thread was.
>
> Izz
>
>
> On Oct 15, 2010, at 5:13 PM, Scott Yoshinaga <[hidden email]> wrote:
>
>> I think I figured out why double inputting "yes" but not sure how to stop it.
>>
>> On my form response page I have this:
>>
>> <input type="checkbox" name="primary_lives_with" value="yes" [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>
>> Then on the update page I have this:
>>
>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes' ?
>> 'yes' | 'no');
>>
>> [Inline: (Action_Params),
>> -Database='ms-hs-forms',
>> -Table='table',
>> 'primary_lives_with'=($primary_lives_with),
>> $Action]    
>>
>> Maybe I need some logic in the inline to not double post?
>>
>>
>>
>> On Oct 15, 2010, at 10:56 AM, Israel Thompson wrote:
>>
>>> Make sure the primary_live_with_box is only being submitted once and
>>> that the value="yes". Also, make sure to use the var
>>> $primary_live_with_box instead of action_param when inserting into the
>>> inline query. To test, try outputting
>>> action_param('primary_live_with_box') at the top of your receiving
>>> page with an abort thereafter to see what's coming across. If it
>>> outputs just a single "yes", the duplicate is occurring further down
>>> in the receiving page.
>>>
>>> Izz
>>>
>>>
>>> On Fri, Oct 15, 2010 at 3:40 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>> Ah! One issue came up.
>>>>
>>>> If the primary_lives_with box is unchecked to start, then it's checked, I'm now seeing "yes yes" input into the db instead of just "yes".
>>>>
>>>> Any ideas?
>>>>
>>>>
>>>> On Oct 15, 2010, at 10:33 AM, Israel Thompson wrote:
>>>>
>>>>> Ahh.. yes.. Slaps self for not writing it that way!
>>>>>
>>>>> Izz
>>>>>
>>>>>
>>>>> On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:
>>>>>> An even shorter way of doing this is:
>>>>>>
>>>>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
>>>>>> 'yes' | 'no');
>>>>>>
>>>>>> Ok, just a tad shorter but is more inline with mainstream programming
>>>>>> since most don't allow complex statements like Izzy did. :~)
>>>>>>
>>>>>> I know there is an even shorter way that escapes me at the moment...
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Steffan
>>>>>>
>>>>>> ---------------------------------------------------------------
>>>>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>>>>> Steffan A. Cline
>>>>>> [hidden email]                             Phoenix, Az
>>>>>> http://www.ExecuChoice.net                                  USA
>>>>>> AIM : SteffanC          ICQ : 57234309
>>>>>> YAHOO : Steffan_Cline   MSN : [hidden email]
>>>>>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>>>>>> ---------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>>>>>>
>>>>>>> Yes.. on the receiving page, but somewhere near the top before any
>>>>>>> inlines would work best.
>>>>>>>
>>>>>>> [action_param('primary_lives_with') == 'yes' ?
>>>>>>> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>>>>>>
>>>>>>> This will define the $primary_lives_with page variable that can be
>>>>>>> utilized anywhere on the receiving page below the line above, so you'd
>>>>>>> want to reference the var instead of the action_param thereafter.
>>>>>>>
>>>>>>> Izz
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>>>>> Hi Israel,
>>>>>>>>
>>>>>>>> Thanks for your help on this.
>>>>>>>>
>>>>>>>> Sorry for the silly question but....
>>>>>>>>
>>>>>>>> For this snippet of code:
>>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>
>>>>>>>> Do I put that in the inline of the receiving page or ?
>>>>>>>> Been trying to work with it for the last few hours but haven't gotten
>>>>>>>> far.
>>>>>>>>
>>>>>>>> thanks
>>>>>>>> \\scott\\
>>>>>>>>
>>>>>>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>>>>>>
>>>>>>>>> Hi Scott,
>>>>>>>>>
>>>>>>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>>>>>>> inside of the conditional statement. So:
>>>>>>>>>
>>>>>>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>>>>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>>>>>> On the receiving page, just look for
>>>>>>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>>>>>>> value for the checkbox, whether it's checked or not, you could set a
>>>>>>>>> simple conditional on the receiving page like so:
>>>>>>>>>
>>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>>
>>>>>>>>> Hope this helps.
>>>>>>>>>
>>>>>>>>> Sincerely,
>>>>>>>>>
>>>>>>>>> Israel Thompson
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>>>>>> wrote:
>>>>>>>>>> Hi all,
>>>>>>>>>>
>>>>>>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>>>>>> checkbox. I can show the result data, but I'm not sure how to handle
>>>>>>>>>> the lasso syntax if the user unchecks the item.
>>>>>>>>>>
>>>>>>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>>>>>> 'primary_lives_with') =='yes'] value="yes"
>>>>>>>>>> checked="checked"[/if] />
>>>>>>>>>>
>>>>>>>>>> How can I get the unchecked data sent back on submission?
>>>>>>>>>>
>>>>>>>>>> \\scott\\
>>>>>>>>>> #############################################################
>>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>>> <[hidden email]>
>>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>>> <[hidden email]>
>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> #############################################################
>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>> <[hidden email]>
>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>> <[hidden email]>
>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> #############################################################
>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>> <[hidden email]>
>>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> #############################################################
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>> the mailing list <[hidden email]>.
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list <[hidden email]>.
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

kimonostereo
In reply to this post by Israel Thompson
Sorry for that last update! Fixed the var statement and now: If it's checked it says yes, if it's not checked it says no.

So it's gotta be in the inline that is double posting somehow.

I'll take a look at your example and see if I can figure something out.

On Oct 15, 2010, at 12:56 PM, Israel Thompson wrote:

> On the update page, after you define the var, but before the try:
>
> $primary_lives_with; abort;
>
> What does that output?
>
> If the output is as desired, remove it and focus on your inline below. Assuming this is a MySQL db, you could write it as follows:
>
> inline(
>    -database='ms-hs-forms',
>    -table='table',
>    -statementonly,
>    -sql='update table set primary_lives_with = "' + $primary_lives_with + '" where id = ' + $id
>    );
>    action_statement; error_currenterror; abort;
> /inline;
>
> Tell us what that outputs. And if you aren't running MySQL, what are you running?
>
> Also, I seem to remember some users experiencing issues with db and tbl names containing dashes, so you might want to look into that... On mobile ATM and don't know exactly where the article or thread was.
>
> Izz
>
>
> On Oct 15, 2010, at 5:13 PM, Scott Yoshinaga <[hidden email]> wrote:
>
>> I think I figured out why double inputting "yes" but not sure how to stop it.
>>
>> On my form response page I have this:
>>
>> <input type="checkbox" name="primary_lives_with" value="yes" [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>
>> Then on the update page I have this:
>>
>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes' ?
>> 'yes' | 'no');
>>
>> [Inline: (Action_Params),
>> -Database='ms-hs-forms',
>> -Table='table',
>> 'primary_lives_with'=($primary_lives_with),
>> $Action]    
>>
>> Maybe I need some logic in the inline to not double post?
>>
>>
>>
>> On Oct 15, 2010, at 10:56 AM, Israel Thompson wrote:
>>
>>> Make sure the primary_live_with_box is only being submitted once and
>>> that the value="yes". Also, make sure to use the var
>>> $primary_live_with_box instead of action_param when inserting into the
>>> inline query. To test, try outputting
>>> action_param('primary_live_with_box') at the top of your receiving
>>> page with an abort thereafter to see what's coming across. If it
>>> outputs just a single "yes", the duplicate is occurring further down
>>> in the receiving page.
>>>
>>> Izz
>>>
>>>
>>> On Fri, Oct 15, 2010 at 3:40 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>> Ah! One issue came up.
>>>>
>>>> If the primary_lives_with box is unchecked to start, then it's checked, I'm now seeing "yes yes" input into the db instead of just "yes".
>>>>
>>>> Any ideas?
>>>>
>>>>
>>>> On Oct 15, 2010, at 10:33 AM, Israel Thompson wrote:
>>>>
>>>>> Ahh.. yes.. Slaps self for not writing it that way!
>>>>>
>>>>> Izz
>>>>>
>>>>>
>>>>> On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:
>>>>>> An even shorter way of doing this is:
>>>>>>
>>>>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
>>>>>> 'yes' | 'no');
>>>>>>
>>>>>> Ok, just a tad shorter but is more inline with mainstream programming
>>>>>> since most don't allow complex statements like Izzy did. :~)
>>>>>>
>>>>>> I know there is an even shorter way that escapes me at the moment...
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Steffan
>>>>>>
>>>>>> ---------------------------------------------------------------
>>>>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>>>>> Steffan A. Cline
>>>>>> [hidden email]                             Phoenix, Az
>>>>>> http://www.ExecuChoice.net                                  USA
>>>>>> AIM : SteffanC          ICQ : 57234309
>>>>>> YAHOO : Steffan_Cline   MSN : [hidden email]
>>>>>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>>>>>> ---------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>>>>>>
>>>>>>> Yes.. on the receiving page, but somewhere near the top before any
>>>>>>> inlines would work best.
>>>>>>>
>>>>>>> [action_param('primary_lives_with') == 'yes' ?
>>>>>>> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>>>>>>
>>>>>>> This will define the $primary_lives_with page variable that can be
>>>>>>> utilized anywhere on the receiving page below the line above, so you'd
>>>>>>> want to reference the var instead of the action_param thereafter.
>>>>>>>
>>>>>>> Izz
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>>>>> Hi Israel,
>>>>>>>>
>>>>>>>> Thanks for your help on this.
>>>>>>>>
>>>>>>>> Sorry for the silly question but....
>>>>>>>>
>>>>>>>> For this snippet of code:
>>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>
>>>>>>>> Do I put that in the inline of the receiving page or ?
>>>>>>>> Been trying to work with it for the last few hours but haven't gotten
>>>>>>>> far.
>>>>>>>>
>>>>>>>> thanks
>>>>>>>> \\scott\\
>>>>>>>>
>>>>>>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>>>>>>
>>>>>>>>> Hi Scott,
>>>>>>>>>
>>>>>>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>>>>>>> inside of the conditional statement. So:
>>>>>>>>>
>>>>>>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>>>>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>>>>>> On the receiving page, just look for
>>>>>>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>>>>>>> value for the checkbox, whether it's checked or not, you could set a
>>>>>>>>> simple conditional on the receiving page like so:
>>>>>>>>>
>>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>>
>>>>>>>>> Hope this helps.
>>>>>>>>>
>>>>>>>>> Sincerely,
>>>>>>>>>
>>>>>>>>> Israel Thompson
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>>>>>> wrote:
>>>>>>>>>> Hi all,
>>>>>>>>>>
>>>>>>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>>>>>> checkbox. I can show the result data, but I'm not sure how to handle
>>>>>>>>>> the lasso syntax if the user unchecks the item.
>>>>>>>>>>
>>>>>>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>>>>>> 'primary_lives_with') =='yes'] value="yes"
>>>>>>>>>> checked="checked"[/if] />
>>>>>>>>>>
>>>>>>>>>> How can I get the unchecked data sent back on submission?
>>>>>>>>>>
>>>>>>>>>> \\scott\\
>>>>>>>>>> #############################################################
>>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>>> <[hidden email]>
>>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>>> <[hidden email]>
>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> #############################################################
>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>> <[hidden email]>
>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>> <[hidden email]>
>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> #############################################################
>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>> <[hidden email]>
>>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> #############################################################
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>> the mailing list <[hidden email]>.
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list <[hidden email]>.
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

Israel Thompson
Ahh.. I figured.

I don't have much experience with FMP, so I'm not sure how much help I
can be from here. Are you sure you need the "action_params" portion in
your inline? Try something like this:

inline(
    -database='database',
    -table='table',
    -statementonly,
    'primary_lives_with'=$primary_lives_with,
    $action
    );
    action_statement; error_currenterror; abort;
/inline;

Izz



On Fri, Oct 15, 2010 at 6:28 PM, Scott Yoshinaga <[hidden email]> wrote:

> Sorry for that last update! Fixed the var statement and now: If it's checked it says yes, if it's not checked it says no.
>
> So it's gotta be in the inline that is double posting somehow.
>
> I'll take a look at your example and see if I can figure something out.
>
> On Oct 15, 2010, at 12:56 PM, Israel Thompson wrote:
>
>> On the update page, after you define the var, but before the try:
>>
>> $primary_lives_with; abort;
>>
>> What does that output?
>>
>> If the output is as desired, remove it and focus on your inline below. Assuming this is a MySQL db, you could write it as follows:
>>
>> inline(
>>    -database='ms-hs-forms',
>>    -table='table',
>>    -statementonly,
>>    -sql='update table set primary_lives_with = "' + $primary_lives_with + '" where id = ' + $id
>>    );
>>    action_statement; error_currenterror; abort;
>> /inline;
>>
>> Tell us what that outputs. And if you aren't running MySQL, what are you running?
>>
>> Also, I seem to remember some users experiencing issues with db and tbl names containing dashes, so you might want to look into that... On mobile ATM and don't know exactly where the article or thread was.
>>
>> Izz
>>
>>
>> On Oct 15, 2010, at 5:13 PM, Scott Yoshinaga <[hidden email]> wrote:
>>
>>> I think I figured out why double inputting "yes" but not sure how to stop it.
>>>
>>> On my form response page I have this:
>>>
>>> <input type="checkbox" name="primary_lives_with" value="yes" [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>
>>> Then on the update page I have this:
>>>
>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes' ?
>>> 'yes' | 'no');
>>>
>>> [Inline: (Action_Params),
>>> -Database='ms-hs-forms',
>>> -Table='table',
>>> 'primary_lives_with'=($primary_lives_with),
>>> $Action]
>>>
>>> Maybe I need some logic in the inline to not double post?
>>>
>>>
>>>
>>> On Oct 15, 2010, at 10:56 AM, Israel Thompson wrote:
>>>
>>>> Make sure the primary_live_with_box is only being submitted once and
>>>> that the value="yes". Also, make sure to use the var
>>>> $primary_live_with_box instead of action_param when inserting into the
>>>> inline query. To test, try outputting
>>>> action_param('primary_live_with_box') at the top of your receiving
>>>> page with an abort thereafter to see what's coming across. If it
>>>> outputs just a single "yes", the duplicate is occurring further down
>>>> in the receiving page.
>>>>
>>>> Izz
>>>>
>>>>
>>>> On Fri, Oct 15, 2010 at 3:40 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>> Ah! One issue came up.
>>>>>
>>>>> If the primary_lives_with box is unchecked to start, then it's checked, I'm now seeing "yes yes" input into the db instead of just "yes".
>>>>>
>>>>> Any ideas?
>>>>>
>>>>>
>>>>> On Oct 15, 2010, at 10:33 AM, Israel Thompson wrote:
>>>>>
>>>>>> Ahh.. yes.. Slaps self for not writing it that way!
>>>>>>
>>>>>> Izz
>>>>>>
>>>>>>
>>>>>> On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:
>>>>>>> An even shorter way of doing this is:
>>>>>>>
>>>>>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
>>>>>>> 'yes' | 'no');
>>>>>>>
>>>>>>> Ok, just a tad shorter but is more inline with mainstream programming
>>>>>>> since most don't allow complex statements like Izzy did. :~)
>>>>>>>
>>>>>>> I know there is an even shorter way that escapes me at the moment...
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Steffan
>>>>>>>
>>>>>>> ---------------------------------------------------------------
>>>>>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>>>>>> Steffan A. Cline
>>>>>>> [hidden email]                             Phoenix, Az
>>>>>>> http://www.ExecuChoice.net                                  USA
>>>>>>> AIM : SteffanC          ICQ : 57234309
>>>>>>> YAHOO : Steffan_Cline   MSN : [hidden email]
>>>>>>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>>>>>>> ---------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>>>>>>>
>>>>>>>> Yes.. on the receiving page, but somewhere near the top before any
>>>>>>>> inlines would work best.
>>>>>>>>
>>>>>>>> [action_param('primary_lives_with') == 'yes' ?
>>>>>>>> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>>>>>>>
>>>>>>>> This will define the $primary_lives_with page variable that can be
>>>>>>>> utilized anywhere on the receiving page below the line above, so you'd
>>>>>>>> want to reference the var instead of the action_param thereafter.
>>>>>>>>
>>>>>>>> Izz
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>>>>>> Hi Israel,
>>>>>>>>>
>>>>>>>>> Thanks for your help on this.
>>>>>>>>>
>>>>>>>>> Sorry for the silly question but....
>>>>>>>>>
>>>>>>>>> For this snippet of code:
>>>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>>
>>>>>>>>> Do I put that in the inline of the receiving page or ?
>>>>>>>>> Been trying to work with it for the last few hours but haven't gotten
>>>>>>>>> far.
>>>>>>>>>
>>>>>>>>> thanks
>>>>>>>>> \\scott\\
>>>>>>>>>
>>>>>>>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>>>>>>>
>>>>>>>>>> Hi Scott,
>>>>>>>>>>
>>>>>>>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>>>>>>>> inside of the conditional statement. So:
>>>>>>>>>>
>>>>>>>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>>>>>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>>>>>>> On the receiving page, just look for
>>>>>>>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>>>>>>>> value for the checkbox, whether it's checked or not, you could set a
>>>>>>>>>> simple conditional on the receiving page like so:
>>>>>>>>>>
>>>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>>>
>>>>>>>>>> Hope this helps.
>>>>>>>>>>
>>>>>>>>>> Sincerely,
>>>>>>>>>>
>>>>>>>>>> Israel Thompson
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>>>>>>> wrote:
>>>>>>>>>>> Hi all,
>>>>>>>>>>>
>>>>>>>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>>>>>>> checkbox. I can show the result data, but I'm not sure how to handle
>>>>>>>>>>> the lasso syntax if the user unchecks the item.
>>>>>>>>>>>
>>>>>>>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>>>>>>> 'primary_lives_with') =='yes'] value="yes"
>>>>>>>>>>> checked="checked"[/if] />
>>>>>>>>>>>
>>>>>>>>>>> How can I get the unchecked data sent back on submission?
>>>>>>>>>>>
>>>>>>>>>>> \\scott\\
>>>>>>>>>>> #############################################################
>>>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>>>> <[hidden email]>
>>>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>>>> <[hidden email]>
>>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> #############################################################
>>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>>> <[hidden email]>
>>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>>> <[hidden email]>
>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> #############################################################
>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>> <[hidden email]>
>>>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> #############################################################
>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> #############################################################
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>> the mailing list <[hidden email]>.
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list <[hidden email]>.
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Update Form and Checkboxes

kimonostereo
Hmmm tried that and still got double Yes.

I've tried many variations to try and get this to work but none of them have yet. At least I'm learning some lasso if/then else syntax but not figuring it out!

LOL :-)

On Oct 15, 2010, at 2:09 PM, Israel Thompson wrote:

> Ahh.. I figured.
>
> I don't have much experience with FMP, so I'm not sure how much help I
> can be from here. Are you sure you need the "action_params" portion in
> your inline? Try something like this:
>
> inline(
>    -database='database',
>    -table='table',
>    -statementonly,
>    'primary_lives_with'=$primary_lives_with,
>    $action
>    );
>    action_statement; error_currenterror; abort;
> /inline;
>
> Izz
>
>
>
> On Fri, Oct 15, 2010 at 6:28 PM, Scott Yoshinaga <[hidden email]> wrote:
>> Sorry for that last update! Fixed the var statement and now: If it's checked it says yes, if it's not checked it says no.
>>
>> So it's gotta be in the inline that is double posting somehow.
>>
>> I'll take a look at your example and see if I can figure something out.
>>
>> On Oct 15, 2010, at 12:56 PM, Israel Thompson wrote:
>>
>>> On the update page, after you define the var, but before the try:
>>>
>>> $primary_lives_with; abort;
>>>
>>> What does that output?
>>>
>>> If the output is as desired, remove it and focus on your inline below. Assuming this is a MySQL db, you could write it as follows:
>>>
>>> inline(
>>>    -database='ms-hs-forms',
>>>    -table='table',
>>>    -statementonly,
>>>    -sql='update table set primary_lives_with = "' + $primary_lives_with + '" where id = ' + $id
>>>    );
>>>    action_statement; error_currenterror; abort;
>>> /inline;
>>>
>>> Tell us what that outputs. And if you aren't running MySQL, what are you running?
>>>
>>> Also, I seem to remember some users experiencing issues with db and tbl names containing dashes, so you might want to look into that... On mobile ATM and don't know exactly where the article or thread was.
>>>
>>> Izz
>>>
>>>
>>> On Oct 15, 2010, at 5:13 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>
>>>> I think I figured out why double inputting "yes" but not sure how to stop it.
>>>>
>>>> On my form response page I have this:
>>>>
>>>> <input type="checkbox" name="primary_lives_with" value="yes" [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>
>>>> Then on the update page I have this:
>>>>
>>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes' ?
>>>> 'yes' | 'no');
>>>>
>>>> [Inline: (Action_Params),
>>>> -Database='ms-hs-forms',
>>>> -Table='table',
>>>> 'primary_lives_with'=($primary_lives_with),
>>>> $Action]
>>>>
>>>> Maybe I need some logic in the inline to not double post?
>>>>
>>>>
>>>>
>>>> On Oct 15, 2010, at 10:56 AM, Israel Thompson wrote:
>>>>
>>>>> Make sure the primary_live_with_box is only being submitted once and
>>>>> that the value="yes". Also, make sure to use the var
>>>>> $primary_live_with_box instead of action_param when inserting into the
>>>>> inline query. To test, try outputting
>>>>> action_param('primary_live_with_box') at the top of your receiving
>>>>> page with an abort thereafter to see what's coming across. If it
>>>>> outputs just a single "yes", the duplicate is occurring further down
>>>>> in the receiving page.
>>>>>
>>>>> Izz
>>>>>
>>>>>
>>>>> On Fri, Oct 15, 2010 at 3:40 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>>> Ah! One issue came up.
>>>>>>
>>>>>> If the primary_lives_with box is unchecked to start, then it's checked, I'm now seeing "yes yes" input into the db instead of just "yes".
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>>
>>>>>> On Oct 15, 2010, at 10:33 AM, Israel Thompson wrote:
>>>>>>
>>>>>>> Ahh.. yes.. Slaps self for not writing it that way!
>>>>>>>
>>>>>>> Izz
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Oct 15, 2010 at 3:20 PM, Steffan A. Cline <[hidden email]> wrote:
>>>>>>>> An even shorter way of doing this is:
>>>>>>>>
>>>>>>>> var('primary_lives_with' = action_param('primary_lives_with') == 'yes ?
>>>>>>>> 'yes' | 'no');
>>>>>>>>
>>>>>>>> Ok, just a tad shorter but is more inline with mainstream programming
>>>>>>>> since most don't allow complex statements like Izzy did. :~)
>>>>>>>>
>>>>>>>> I know there is an even shorter way that escapes me at the moment...
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> Steffan
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>>>>>>> Steffan A. Cline
>>>>>>>> [hidden email]                             Phoenix, Az
>>>>>>>> http://www.ExecuChoice.net                                  USA
>>>>>>>> AIM : SteffanC          ICQ : 57234309
>>>>>>>> YAHOO : Steffan_Cline   MSN : [hidden email]
>>>>>>>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>>>>>>>> ---------------------------------------------------------------
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 10/15/10 1:14 PM, "Israel Thompson" <[hidden email]> wrote:
>>>>>>>>
>>>>>>>>> Yes.. on the receiving page, but somewhere near the top before any
>>>>>>>>> inlines would work best.
>>>>>>>>>
>>>>>>>>> [action_param('primary_lives_with') == 'yes' ?
>>>>>>>>> var('primary_lives_with' = 'yes') | var('primary_lives_with' = 'no')]
>>>>>>>>>
>>>>>>>>> This will define the $primary_lives_with page variable that can be
>>>>>>>>> utilized anywhere on the receiving page below the line above, so you'd
>>>>>>>>> want to reference the var instead of the action_param thereafter.
>>>>>>>>>
>>>>>>>>> Izz
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, Oct 15, 2010 at 3:03 PM, Scott Yoshinaga <[hidden email]> wrote:
>>>>>>>>>> Hi Israel,
>>>>>>>>>>
>>>>>>>>>> Thanks for your help on this.
>>>>>>>>>>
>>>>>>>>>> Sorry for the silly question but....
>>>>>>>>>>
>>>>>>>>>> For this snippet of code:
>>>>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>>>
>>>>>>>>>> Do I put that in the inline of the receiving page or ?
>>>>>>>>>> Been trying to work with it for the last few hours but haven't gotten
>>>>>>>>>> far.
>>>>>>>>>>
>>>>>>>>>> thanks
>>>>>>>>>> \\scott\\
>>>>>>>>>>
>>>>>>>>>> On Oct 14, 2010, at 9:40 AM, Israel Thompson wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi Scott,
>>>>>>>>>>>
>>>>>>>>>>> Since the checkbox is either on or off, the value doesn't need to be
>>>>>>>>>>> inside of the conditional statement. So:
>>>>>>>>>>>
>>>>>>>>>>> <input type="checkbox" name="primary_lives_with" value="yes"
>>>>>>>>>>> [field('primary_lives_with') == 'yes' ? 'checked="checked"'] />
>>>>>>>>>>> On the receiving page, just look for
>>>>>>>>>>> action_param('primary_lives_with') == 'yes'. If you have to have a
>>>>>>>>>>> value for the checkbox, whether it's checked or not, you could set a
>>>>>>>>>>> simple conditional on the receiving page like so:
>>>>>>>>>>>
>>>>>>>>>>> action_param('primary_lives_with') == 'yes' ? var('primary_lives_with'
>>>>>>>>>>> = 'yes') | var('primary_lives_with' = 'no');
>>>>>>>>>>>
>>>>>>>>>>> Hope this helps.
>>>>>>>>>>>
>>>>>>>>>>> Sincerely,
>>>>>>>>>>>
>>>>>>>>>>> Israel Thompson
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Oct 14, 2010 at 1:56 PM, Scott Yoshinaga <[hidden email]>
>>>>>>>>>>> wrote:
>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>
>>>>>>>>>>>> I have result data that I'm trying to update. One of the fields is a
>>>>>>>>>>>> checkbox. I can show the result data, but I'm not sure how to handle
>>>>>>>>>>>> the lasso syntax if the user unchecks the item.
>>>>>>>>>>>>
>>>>>>>>>>>> <input type="checkbox" name="primary_lives_with" [if: (field:
>>>>>>>>>>>> 'primary_lives_with') =='yes'] value="yes"
>>>>>>>>>>>> checked="checked"[/if] />
>>>>>>>>>>>>
>>>>>>>>>>>> How can I get the unchecked data sent back on submission?
>>>>>>>>>>>>
>>>>>>>>>>>> \\scott\\
>>>>>>>>>>>> #############################################################
>>>>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>>>>> <[hidden email]>
>>>>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>>>>> <[hidden email]>
>>>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> #############################################################
>>>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>>>> <[hidden email]>
>>>>>>>>>>> To switch to the INDEX mode, E-mail to
>>>>>>>>>>> <[hidden email]>
>>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> #############################################################
>>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>> To switch to the DIGEST mode, E-mail to
>>>>>>>>>> <[hidden email]>
>>>>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> #############################################################
>>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> #############################################################
>>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>> the mailing list <[hidden email]>.
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> #############################################################
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>> the mailing list <[hidden email]>.
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list <[hidden email]>.
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list <[hidden email]>.
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list <[hidden email]>.
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <[hidden email]>.
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>>> To switch to the INDEX mode, E-mail to <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list <[hidden email]>.
>> To unsubscribe, E-mail to: <[hidden email]>
>> To switch to the DIGEST mode, E-mail to <[hidden email]>
>> To switch to the INDEX mode, E-mail to <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>