Hello,
I have 2 checkBoxes in a form :
{check0} and {check1} with just one possibility for each one. For exemple:
"Are you a smoker?" [ ] Yes ({check0})
"Will you take the train?" [ ] Yes ({check1})
And that's it.
What I would like to do is :
It always answer "No".
But it's not working, I tried everything even using directly {check1} instead of $check1.
If I use some echo to see what's in {check1} it answer "Yes" if the CheckBox was checked in the form and {check1} if it was not.
To me it makes no sense, any help would be great, I've spent all my monday on this π
I have 2 checkBoxes in a form :
{check0} and {check1} with just one possibility for each one. For exemple:
"Are you a smoker?" [ ] Yes ({check0})
"Will you take the train?" [ ] Yes ({check1})
And that's it.
What I would like to do is :
<?php
$check1 = "{check1}";
if ($check1 == "Yes")
{
echo "Yes";
}else{
echo "No";
}
?>
It always answer "No".
But it's not working, I tried everything even using directly {check1} instead of $check1.
If I use some echo to see what's in {check1} it answer "Yes" if the CheckBox was checked in the form and {check1} if it was not.
To me it makes no sense, any help would be great, I've spent all my monday on this π
Hi Killy,
Try
Bob
PS Yes/No radio button pairs make this easier.
Try
<?php
if ( {$check1} )
{
echo "Yes";
}else{
echo "No";
}
?>
Bob
PS Yes/No radio button pairs make this easier.
Thanks for the answer (you're fast π ).
Should not this be more like that :
Either way it gives a "Yes" everytime now.
(i'll try the Yes/No radio button, but still I'm curious about this)
Should not this be more like that :
<?php
if ( "{check1}" )
{
echo "Yes";
}else{
echo "No";
}
?>
Either way it gives a "Yes" everytime now.
(i'll try the Yes/No radio button, but still I'm curious about this)
Hi Killy,
Sorry there was a typo in there but not that one, try this (no $, no quote):
Bob
Sorry there was a typo in there but not that one, try this (no $, no quote):
<?php
if ( {check1} )
{
echo "Yes";
}else{
echo "No";
}
?>
Bob
Parse error !
I guess it does not like the {}.
I give up anyway, i wrote something with some radio buttons. Could you give me the code correspondig please?
I tried to test it with {radio00} {radio01} but it returns just {radio00}{radio01}.
edit: Nevermind {radio0} did the trick ! Thanks againπ
I guess it does not like the {}.
I give up anyway, i wrote something with some radio buttons. Could you give me the code correspondig please?
I tried to test it with {radio00} {radio01} but it returns just {radio00}{radio01}.
edit: Nevermind {radio0} did the trick ! Thanks againπ
This topic is locked and no more replies can be posted.