Nope, this only works if the string is a variant of True, not on the 1,
yes, si cases :)
Also, only value supposed to be sent by browser is the value="...."
field of input checkbox. And html 4 specs states that for checkboxes and
radio boxes this value *must* be present in html :)
Yeah, i too thought to post this request on sidebar. Long time not seen
a Paula related stuff. Did you code a Calculator recently? :D
Christopher Schultz a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Massimiliano,
>
> Massimiliano PASQUALONI wrote:
>
> String Paula = "Brilliant";
>
> You can replace all the code below with this gem:
>
> boolean myBoolean = Boolean.valueOf(yourString).booleanValue();
>
> Don't try to re-invent the wheel. Most of the things like this have
> already been done by someone else, and probably better. So, learn from
> and take advantage of the work others have done before you.
>
>
>> public boolean StringToBoolean(String StrBool)
>> {
>> boolean convertito=false;
>>
>> if ((StrBool == "1") || (StrBool == "On") || (StrBool ==
>> "on") || (StrBool == "Yes") || (StrBool == "yes") || (StrBool == "Si") ||
>> (StrBool == "si") || (StrBool == "True") || (StrBool == "true"))
>> {
>> convertito = true;
>> }
>>
>> if ((StrBool == "0") || (StrBool == "Off") || (StrBool ==
>> "off") || (StrBool == "No") || (StrBool == "no") || (StrBool ==
>> "False")
>> || (StrBool == "false"))
>> {
>> convertito = false;
>> }
>>
>> return convertito;
>> }
>>
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGUzgE9CaO5/Lv0PARAlJJAJ9XdavG7OXesi3bTaqMVdrJe3nUqwCgwuNU
> 2K2hHPrMKDH8NLAHvKcR8ek=
> =fK6t
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: [email protected]
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]