OK everybody!!! I am dancing now!!! I finaly found the solution!!! it was from
the php... I post this cause everybody should be more attentive at quotes in
order to have the clean html of whatever code... here is the php:
if ($row1['well'.$i]=="0") {echo '<div id="well'.$i.'" class="toggle"
onClick="onChangeToggle('; echo "'well".$i."')"; echo'">';}
else {echo '<div id="well'.$i.'" class="toggle" onClick="onChangeToggle('; echo
"'well".$i."')"; echo'" toggled="true">';}
________________________________
From: Remi Grumeau <[email protected]>
To: [email protected]
Sent: Wed, December 2, 2009 7:38:48 PM
Subject: Re: Getting toggle value true/false in php
Try id="well[$1]" ;)
Le 2 déc. 2009 à 17:26, Bontas George a écrit :
Hi Niels,
>
>Same error well1 for example is not defined. Don't know why.. maybe the same
>thing as with javascript issue. Don't realy know because definately the well
>has id="well1" and the function has the atribute well1... so I don't
>understand why document.getElementById(well); returns NULL...
>
>
>Thanks everybody!!!
>
>
>
>
________________________________
From: Niels Leenheer <[email protected]>
>To: [email protected]
>Sent: Wed, December 2, 2009 4:45:02 PM
>Subject: Re: Getting toggle value true/false in php
>
>Try this:
>
>
>function onChangeToggle(well) {
> var act = document.getElementById(well);
> act.toggled = (act. toggled == "true") ? "false" : "true";
> alert(act.toggled);
>}
>
>
>Cheers,
>
>
>Niels
>Creatype
>
>
>
>On Wed, Dec 2, 2009 at 8:21 AM, Bontas George <[email protected]>
>wrote:
>
>Yes!!! Great! httprequest can solve my isue! But now I am struggling to find
>out how to read the toggle with javascript! I don't understand something:
>>I have this PHP:
>>while ($i<=24)
>>{
>> echo '<div class="row">
>> <label>Well'.$i.'</label>';
>> if ($row1['well'.$i]=="0") echo '<div id="well'.$i.'"
>> class="toggle" onClick="onChangeToggle(well'.$i.')">';
>> else echo '<div id="well'.$i.'" class="toggle"
>> onClick="onChangeToggle(well'.$i.')" toggled="true">';
>> echo '<span class="thumb"></span>
>> <span class="toggleOn">ON</span>
>> <span class="toggleOff">OFF</span>
>> </div>
>> </div>';
>> $i++;
>>}
>> that is creating 24 rows with a toggle that have the id=well1, well2....
>> Than I created a javascript:
>>function onChangeToggle(well) {
>> var act = document.getElementById(well);
>> act.value = (act.value == "On") ? "Off" : "On";
>> alert(act.value);
>>}
>>And this javascript gives me the error in the console well1 not defined if
>>well1 pressed?? why? any ideas?
>>
>>
________________________________
From: Remi Grumeau <[email protected]>
>>To: [email protected]
>>Sent: Tue, December 1, 2009 6:21:03 PM
>>Subject: Re: Getting toggle value true/false in php
>>
>>
>>As far as i remember dealing with a for using iUI, all is done with
>>Javascript.
>>So you have to give a name (example : <form name"my_form">) and put a
>>javascript call on the submit button.
>>Parsing the form object with your Javascript will then do the job (using an
>>httprequest to your PHP file)
>>
>>Remi
>>
>>Le 1 déc. 2009 à 15:43, Mark Tomlin a écrit :
>>
>>> From what I can tell the current state of things does not put the
>>> toggle switch in a POST or GET variable. I love being wrong tho...
>>>
>>> On Tue, Dec 1, 2009 at 8:18 AM, Bontas George
>>> <[email protected]> wrote:
>>>> Hello everybody!
>>>>
>>>> I'm using iUI for my web application. I am trying to get with the help of
>>>> method $_POST[""] the values of toggle after being changed. This is because
>>>> I need to update a database so I cannot put into a file all iui forms. Or
>>>> any helping ideas??
>>>>
>>>> Thank you!!
>>>>
>>>> Best regards,
>>>> George
>>>>
>>>>
>>>> --
>>>>
>>>> You received this message because you are subscribed to the Google Groups
>>>> "iPhoneWebDev" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/iphonewebdev?hl=en.
>>>>
>>>
>>>
>>>
>>> --
>>> Thank you for your time,
>>> Mark 'Dygear' Tomlin;
>>>
>>> --
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "iPhoneWebDev" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/iphonewebdev?hl=en.
>>>
>>>
>>
>>
>>Remi Grumeau
>>(+33) 663 687 206
>>http://www.remi-grumeau.com
>>
>>
>>
>>
>>
>>--You received this message because you are subscribed to the Google Groups
>>"iPhoneWebDev" group.
>>To post to this group, send email to [email protected].
>>To unsubscribe from this group, send email to
>>[email protected].
>>For more options, visit this group at
>>http://groups.google.com/group/iphonewebdev?hl=en.
>>
>
>
>
>--You received this message because you are subscribed to the Google Groups
>"iPhoneWebDev" group.
>To post to this group, send email to [email protected].
>To unsubscribe from this group, send email to
>[email protected].
>For more options, visit this group at
>http://groups.google.com/group/iphonewebdev?hl=en.
>
>
>
>
>--You received this message because you are subscribed to the Google Groups
>"iPhoneWebDev" group.
>To post to this group, send email to [email protected].
>To unsubscribe from this group, send email to
>[email protected].
>For more options, visit this group at
>http://groups.google.com/group/iphonewebdev?hl=en.
>
Remi Grumeau
(+33) 663 687 206
http://www.remi-grumeau.com
--
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en.