INPUT class=text id=myCheck1 type=checkbox?php echo( $row[33] ==
'no' ? ' checked=checked' : '' ); ? value=PFDs
name=f_sequipment1/bfont size=2PFDsb
Or with short tags:
INPUT class=text id=myCheck1 type=checkbox?= $row[33] == 'no' ? '
checked=checked' : '' ? value=PFDs name=f_sequipment1/bfont
Ronald Wiplinger wrote:
How can I force a n for not checked in the input field? or how can I
solve that?
Either use radio buttons or a drop down for the input field.
Stephen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stephen wrote:
Ronald Wiplinger wrote:
How can I force a n for not checked in the input field? or how can I
solve that?
Either use radio buttons or a drop down for the input field.
Thanks!
Stephen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
First of all, using y and n for boolean values (such as a checkbox) is
very sloppy. n is boolean True. A boolean value should evaluate correctly
in a boolean context. For that, you should use 1 and 0 for your values.
What I usually do is this:
input type=hidden name=foo value=0 /
input
I did once, if I remember once, this strategy:
input type=hidden name=R_a value=n
input type=checkbox name=R_a value=y ?php echo $checked ?
If checked, you will have value y. Though, if unchecked, or it was
checked and visitor unchecked, the value should be n.
;)
-afan
Ronald Wiplinger
Just to add my two cents -
I don't think it matters much what tokens you use to represent true
or false, since you're going to be explicitly checking them on the
server end anyway. I can't see much difference in principle between,
for example:
if ($_GET['foo'] == 'y')...
and
nice!
but to avoid confusion it should read (assuming that $checked is a boolean
variable):
input type=hidden name=foo value=0/
input type=checkbox name=foo value=1?php if($checked) echo '
checked'; ?/
IMHO
Larry Garfield wrote:
First of all, using y and n for boolean values (such as a
At 12:36 PM -0600 12/2/07, Larry Garfield wrote:
First of all, using y and n for boolean values (such as a checkbox) is
very sloppy. n is boolean True. A boolean value should evaluate correctly
in a boolean context. For that, you should use 1 and 0 for your values.
What I usually do is
On Dec 2, 2007 1:08 PM, tedd [EMAIL PROTECTED] wrote:
At 12:36 PM -0600 12/2/07, Larry Garfield wrote:
First of all, using y and n for boolean values (such as a checkbox) is
very sloppy. n is boolean True. A boolean value should evaluate correctly
in a boolean context. For that, you should
At 1:23 PM -0800 12/2/07, Casey wrote:
On Dec 2, 2007 1:08 PM, tedd [EMAIL PROTECTED] wrote:
You don't need to do anything.
input type=checkbox name=likes_pie /
When it's submitted:
?php
if ($_GET['likes_pie']) // checked
else // not
That's true unless you're pulling data in from somewhere
On Thursday 01 June 2006 12:58, Rahul S. Johari wrote:
Ave,
I¹m stuck on a problem here.
I have a file manager kind of application and I¹m trying to add the
functionality to delete multiple files.
Basically, there¹s a bunch of rows generated dynamically. Each row has a
checkbox for
Ave,
I spent 3 hours trying to find or develop a solution for this problem... And
believe it or not, within 3 minutes of sending the problem to the mailing
list, I actually generated a solution!! Ray, you’re spot on with what’s
actually happening, but this is what I did to resolve it...
Here’s
On Thursday 01 June 2006 13:15, Rahul S. Johari wrote:
Ave,
I spent 3 hours trying to find or develop a solution for this problem...
And believe it or not, within 3 minutes of sending the problem to the
mailing list, I actually generated a solution!! Ray, you’re spot on with
what’s actually
Ray,
Interestingly, I don't' allow special characters in File Names for files
being uploaded to the File Manager. So that problem won't occur.
Thanks.
On 6/1/06 4:23 PM, Ray Hauge [EMAIL PROTECTED] wrote:
On Thursday 01 June 2006 13:15, Rahul S. Johari wrote:
Tad different, but that will
isset($_POST['checkboxname']) or isset($_GET['checkboxname'])
depending on the method of your form.
a good thing to do is to do var_dump($_POST) or var_dump($_GET) to see
all the values posted from the form...
hth
ken
On Thu, 24 Mar 2005 15:42:10 +0200, William Stokes [EMAIL PROTECTED] wrote:
# index.php
form method=post action=index.php
?php
$checked = ($_POST['CheckThis'] == 'Yes') ? 'checked' : '' ;
input type=checkbox name=CheckThis value=Yes ?= $checked ?
input type=Submit value=Submit
/form
-afan
William Stokes wrote:
Hello,
I have a checkbox in a form. How can I determine if
On 05 October 2004 11:10, Angelo Zanetti wrote:
Hi all,
this might be slightly off-topic in a way but Im looking for help not
flaming.
Ok I have a checkbox array that I populate from a DB using php:
while ($row = mysql_fetch_array($result))
echo(input type=checkbox
Angelo Zanetti wrote:
but what I want to clarify is that if I change my PHP echo statement
to:
echo(input type=checkbox name=chkmodels value= . $row['models_id'] .
. $row['models_type'] . br);
basically without the [] then it is still recognised as an array. But
when the array is passed back it
Angelo Zanetti wrote:
Here is the OT part. how do I reference the checkboxes in javascript if
the chkmodels[] is used?
I have tried many things like:
myCheckboxArray = document.forms[0].elements[chkmodels[]];
The above should work. Is it really the first form on the page?
--
PHP General Mailing
its the only form on the page...
Based on the other responses I will have to use chkmodels[] and need to
get the javascript working. Is it not possible to use the forms name
when referencing the array?
thank again.
Angelo
Marek Kilimajer [EMAIL PROTECTED] 10/5/2004 1:52:02 PM
Angelo Zanetti
Angelo Zanetti wrote:
its the only form on the page...
Based on the other responses I will have to use chkmodels[] and need to
get the javascript working. Is it not possible to use the forms name
when referencing the array?
You should be able to use:
document.formName
document.forms[0]
Hi Marek,
I try to access the array like this:
document.frmft.elements[chkmodels[]];
but doesnt work. I also tried this:
models = document.forms['frmft'].elements[chkmodels[]];
is there not a problem with the elements part?
thanks
Marek Kilimajer [EMAIL PROTECTED] 10/5/2004 2:19:26 PM
On 05 October 2004 13:55, Angelo Zanetti wrote:
Hi Marek,
I try to access the array like this:
document.frmft.elements[chkmodels[]];
but doesnt work. I also tried this:
models = document.forms['frmft'].elements[chkmodels[]];
is there not a problem with the elements part?
So long
thanks Mike,
worked like a charm!!
and thanks to the others who replied!
Ford, Mike [EMAIL PROTECTED] 10/5/2004 3:09:32 PM
On 05 October 2004 13:55, Angelo Zanetti wrote:
Hi Marek,
I try to access the array like this:
document.frmft.elements[chkmodels[]];
but doesnt work. I
Hi Nick,
Nick Wilson wrote:
Hi all,
[...]
INPUT TYPE=checkbox NAME=a VALUE=on
so, what is it? a=what?
[...]
if a was checked a=on is posted (or 'get'ed)
if not checked a isn't set.
Thanks very much!
You're welcome
Stephan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Stephan Fiedler wrote:
Hi Nick,
Nick Wilson wrote:
Hi all, [...]
INPUT TYPE=checkbox NAME=a VALUE=on
so, what is it? a=what?
[...]
if a was checked a=on is posted (or 'get'ed)
if not checked a isn't set.
Thanks very much!
You're welcome
Stephan
that actually depends on the browser. Mayne
* Thus wrote Nick Wilson:
Hi all,
Im using php's cURL module to submit a form on a remote site. All is
*good* so far but i dont know what parameter to pass to ensure that
this checkbox is 'checked':
INPUT TYPE=checkbox NAME=a VALUE=on
TIAS.
a=value|on)
which ever the browser seems
Try foreach ($_POST['textfield'] as $num = $value);
On Wed, 30 Jun 2004 15:56:35 +0800, Aris Santillan
[EMAIL PROTECTED] wrote:
how can process only items with checked check-box?
--- html ---
html
head
titleUntitled Document/title
/head
body
form
If you put square brackets after the name (e.g. var[]) your form should
produce an array called $_POST[var] that comprises the checked boxes
only.
e.g.
form method=post ...
input type=checkbox name=var[] value=value1
input type=checkbox name=var[] value=value2
input type=checkbox name=var[]
At 19:16 17-7-03, you wrote:
you understand it correctly
ok so i really have to add another kludgy workaround to my form class :/
but thanks for confirming!
Chris
- Original Message -
From: Chris Hayes (SENSE) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 17, 2003 9:57
Chris Hayes (SENSE) wrote:
if i understand well, a checkbox in a form is only send on to the next
page when it is checked: so the next page will only see a value in
$_POST['checkboxname'] if it is set: else it is not set. Right?
So the followup page cannot see the difference between a form
Hello
From a usability standpoint showing a checkbox that cannot be unchecked
renders the checkbox obsolete. The consquence is not to show a checkbox at
all. If you need an uncheckable checkbox because of licence aggreements or
something like that. Or privacydeclaration type checkbox. Make it
On Thursday 27 March 2003 03:26, Reuben D. Budiardja wrote:
But isn't it so much easier to type in that one line HTML + javascript than
trying to get an image of a checked check box.. unless you have that
handy, you'd have to eg. take a snapshot, or draw something, then save the
file as
: Wednesday, March 26, 2003 2:26 PM
Subject: Re: [PHP] Checkbox
On Wednesday 26 March 2003 02:11 pm, CPT John W. Holmes wrote:
On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
is it possible to have a checkbox that if it is specified to be
checked
when the page is being
On Wednesday 26 March 2003 09:16 am, shaun wrote:
Hi,
is it possible to have a checkbox that if it is specified to be checked
when the page is being formulated then it cannot be unchecked?
When you write the page, if the checkbox is checked initially, write also a
javascript to prevent it
is it possible to have a checkbox that if it is specified to be checked
when the page is being formulated then it cannot be unchecked?
No. No... No.
If you already know you don't want it to be unchecked, then don't show a
checkbox. That's why we have PHP, so you can create your page
On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
is it possible to have a checkbox that if it is specified to be checked
when the page is being formulated then it cannot be unchecked?
No. No... No.
If you already know you don't want it to be unchecked, then don't show a
On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
is it possible to have a checkbox that if it is specified to be
checked
when the page is being formulated then it cannot be unchecked?
No. No... No.
If you already know you don't want it to be unchecked, then don't show a
On Wednesday 26 March 2003 02:11 pm, CPT John W. Holmes wrote:
On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
is it possible to have a checkbox that if it is specified to be
checked
when the page is being formulated then it cannot be unchecked?
No. No... No.
:26 PM
Subject: Re: [PHP] Checkbox
On Wednesday 26 March 2003 02:11 pm, CPT John W. Holmes wrote:
On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
is it possible to have a checkbox that if it is specified to be
checked
when the page is being formulated then it cannot
I agree...and like John said, as long as you don't accept any changes
when you process the form you should be good to go...
-Original Message-
From: Tim Burden [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 2:25 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Checkbox
Just using
But isn't it so much easier to type in that one line HTML + javascript
than
trying to get an image of a checked check box.. unless you have that
handy, you'd have to eg. take a snapshot, or draw something, then save the
file as an image file...hmm...
and as you said, the effect will
and unchecking the box. Only the DISABLED flag does. Readonly
apparently prevents the user from altering the value of the input field.
-Original Message-
From: Tim Burden [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 11:25 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Checkbox
Just
hello,
how can i get the output file from the curl function to stream - to be
processed like from fopen or fsockopen?
thanks...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
At 19:57 16.02.2003, Dhaval Desai said:
[snip]
I have a form with 5 checkboxes. I want to make sure that a user checks
atleast 2 boxes before he can proceed. How can that be made possible.
[snip]
You have 2 options:
How do we do it using the first option i.e javascript to count how many
boxes are checked...could you give some example...
Thanx
-Dhaval
From: David McInnis [EMAIL PROTECTED]
To: 'Dhaval Desai' [EMAIL PROTECTED]
Subject: RE: [PHP] Checkbox related...
Date: Sun, 16 Feb 2003 10:59:17 -0800
At 20:34 16.02.2003, Dhaval Desai said:
[snip]
How do we do it using the first option i.e javascript to count how many
boxes are checked...could you give some example...
[snip]
Warning - untested:
script
On Tue, 1 Oct 2002, DonPro wrote:
Within my form, I have some checkbox objects. If I check them and submit my
form, isset(variable) returns true. However, if I do not check them and
submit my form, isset(variable) returns false.
I am confused as I though that isset() returns true if the
If you cannot use square brackets, get the values yourself from
$_SERVER['QUERY_STRING']
Alex Shi wrote:
How to ontain data from a group of checkbox using same name?
For example, in a form there're 6 checkboxes and all named as
Interesting_Area. I know if put a pairs of square brackets at the
Thanks for your reply!
I tested $_SERVER['QUERY_STRING']. Seems like it only return the
string for get method but not for post. Any idea?
Alex
Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
If you cannot use square brackets, get the values
I am executing the follwoing statement as part of a while loop.
This is part of a form and I wish to pass the name and value of the
checkbox as a hidden field only is the checkbox is checked. Can you
suggest how I can accomplish this task?
tdinput type=checkbox name=d_c_arr[] value=?php
you need to define the key for checkbox arrays in order to distinguish them
(as only the checked ones will be posted)..
something like ...
tdinput type=checkbox name=d_c_arr[?php echo($count++); ?]/td
Tim Ward
www.chessish.com
-Original Message-
From: Paul Maine [mailto:[EMAIL
You are wrong, this is from HTML 4.01 specification:
value = /cdata/ cid:[EMAIL PROTECTED] [CA]
cid:[EMAIL PROTECTED]
This attribute specifies the initial value cid:[EMAIL PROTECTED] of
the control. It is optional except when the
type cid:[EMAIL PROTECTED] attribute has the value radio or
Some check box info here too:
http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20117420.html
- Victor www.argilent.com
-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 7:24 AM
To: PHP
Subject: Re: [PHP] Re: PHP checkbox
Marek Kilimajer wrote:
You are wrong, this is from HTML 4.01 specification:
You're right. Thanks for your reply!
Grtz Erwin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Friday 16 August 2002 17:54, José Jeria wrote:
I have a page with a checkbox, when i submit to the next page the
variable $whatever (the checkboxes name.) will be On if its checked,
and it will be undefined if its not checked.
Shouldn't it be a empty string? and not undefined?
That is
Hmmm, then the book Beginning PHP from Wrox is wrong...
/J
Jason Wong wrote:
On Friday 16 August 2002 17:54, José Jeria wrote:
I have a page with a checkbox, when i submit to the next page the
variable $whatever (the checkboxes name.) will be On if its checked,
and it will be undefined if
I'm doing something very similar on a project I'm working on, except I'm
using radio buttons. I'm not quite sure what are using the ID for (for
style sheets or a data ID). If you are using it as a data ID, then you
can make it part of the topic[] array. So it would look like this:
input
On Sat, Aug 10, 2002 at 02:56:48PM -0400, PeterV wrote:
What I have now:
input type='checkbox' id='45' name='topic[]' value='45'
doesn't return an array $topic??
Probaby due to register_globals. It should exist in $_POST['topic']
--
Jason Stechschulte
[EMAIL PROTECTED]
On Wed, 1 May 2002, Daniel Negron/KBE wrote:
Kinda off topic here, just checking to see If I am on the right track with
this
input type=checkbox name=abb value=?php echo $myrow['abb'] ?
the result should be :
IF the record contains the field abb and it has a value of 1 then it will
be
It will only be checked if you put CHECKED in your HTML.
if($myrow['abb'] == 1) { echo checked ; }
Add that into your input element.
---John Holmes...
- Original Message -
From: Daniel Negron/KBE [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 01, 2002 1:04 PM
Subject:
Kinda off topic here, just checking to see If I am on the right track with
this
input type=checkbox name=abb value=?php echo $myrow['abb'] ?
the result should be :
IF the record contains the field abb and it has a value of 1
then it will
be checked off for viewing.
No, that wouldn't
At 04.04.2002 15:23, you wrote:
I have a html form with some text (T1) and checkbox (C1) fields to pass
it to a php script.
Accessing text fields has no problem.
There is a problem when I use
$C1=$HTTP_POST_VARS['C1']
to take the value of C1 (ON)
If it is not checked, then it is not set at
On Thursday 04 April 2002 20:46, [EMAIL PROTECTED] wrote:
why do you use $HTTP_POST_VARS? Do I miss something?
For security reasons.
Manual Security
--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
/*
Above all things, reverence yourself.
*/
--
PHP General Mailing List
: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 5:51 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] checkbox doesn't pass?
On Thursday 04 April 2002 20:46, [EMAIL PROTECTED] wrote:
why do you use $HTTP_POST_VARS? Do I miss something?
For security reasons.
Manual
At 18:17 04-04-02 +0300, savaidis wrote:
But IF I still want to use $HTTP_POST_VARS, what then? What about the
warning when checkbox is not checked?
I use empty() to check the for the existence of checkbox variables.
--
-
You should use $HTTP_POST_VARS (or $_POST) all of the time. There's security risks in
using register_globals. It's not risky in all cases. But register_globals will allow
arbitrary variables to be added to into the name space of your script by simply
putting them on the uri. Code not
But IF I still want to use $HTTP_POST_VARS, what then? What about the
warning when checkbox is not checked?
I use empty() to check the for the existence of checkbox variables.
You can also use isset();
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Unchecked checkboxes pass no values, that's how
it works. It's either set or not. Default value
for a checkbox is 'on' although you can change
that. isset() will work fine.
Regards,
Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hi jacky,
put an empty square bracket after the variable name as follows:
input type=checkbox name=id[ ] value=$id
assuming that your above statement is in a loop we will have following
structure:
*
form
input type=checkbox name=id[ ] value=$id
input
After I submit to next page, at next page, how do I check which
check box is checked?
like this?
if ($id=="on") {
do something
}else{
do something
}
Hi
try this assuming you have no toher check boxes called $id
if(isset($id))
{
do something
}else{
do other
}
M@
--
PHP
Jacky wrote:
Hi all
I have a form with the checkbox like this
form
$query="select id from foo";
$result=($query,$con);
while ($row = mysql_fetch_array($result))
{
input type="checkbox" name="$id" value="on"
}
submit button and stuffs here...
/form
One possibility:
72 matches
Mail list logo