logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: [FormBuilder] tovar() and negative option value/labels: msg#00008

Subject: Re: [FormBuilder] tovar() and negative option value/labels
On 1/4/07, Nate Wiger <nwiger@xxxxxxxxx> wrote:
On 1/3/07, Steve Schwarz <agilitynerd@xxxxxxxxx> wrote:
> Hi,
> I've found an issue where if I create a radio group with option values of -4
> to 4
>     $form->field(name =>'persistence', type=>'radio', options=>[-4..4],
> validate=>'NUM', required=>1);
[snip]
> You'll notice the label's for and id attributes are the same for -4 and 4
> and for 3 and -3 etc. So users clicking on the negative label cause the
> positive entry to be selected.

Hmmm, seems like the easiest fix would be to change tovar so that it
does a 1-for-1 substitution of \W+ as _. Right now, it squishes
multiples for HTML prettiness. So, with this solution you'd end up

[snip]
Nate ,
Thanks for the quick reply.

I think I'll go with the non-squishing solution (I've always liked solving problems by deleting code... :^)
You don't forsee other  problems with making this change? It seems tovar() is only being called in this type of use case so as long as the id is unique(uniquer) and valid we should be ok...
Thanks again,
Steve



_______________________________________________
FBusers mailing list
FBusers@xxxxxxxxxxxxxxx
http://www.formbuilder.org/mailman/listinfo/fbusers

Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>