Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > rant and gripe time - checkboxes

Reply
Thread Tools

rant and gripe time - checkboxes

 
 
richard
Guest
Posts: n/a
 
      09-05-2013
It's been a long long time since I did anything with checkboxes.
So I tried searching on the subject and what did I find?
The same damn thing on a few dozen websites.
They all show how the code is to be to have a checkbox.
Not a damn one of them say how to work with that code.
Ok. So you have the checkbox and all the needed information.
Now what?
Somewhere, somehow, some action is required to pass the value contained in
the checkbox to something else.
But none of these sites explain how this is done.

Anyone have a proper site that gives a more complete example of how to
completely implement a checkbox?
 
Reply With Quote
 
 
 
 
Ben Bacarisse
Guest
Posts: n/a
 
      09-05-2013
richard <(E-Mail Removed)> writes:

> It's been a long long time since I did anything with checkboxes.
> So I tried searching on the subject and what did I find?
> The same damn thing on a few dozen websites.
> They all show how the code is to be to have a checkbox.
> Not a damn one of them say how to work with that code.
> Ok. So you have the checkbox and all the needed information.
> Now what?


The user submits the form, usually by clicking a "submit" button. What
happens after this depends on the "action" and "method" attributes in
of the form in question.

> Somewhere, somehow, some action is required to pass the value contained in
> the checkbox to something else.
> But none of these sites explain how this is done.


It's hard to say much more because it depends on what technology is used
to process the form.

> Anyone have a proper site that gives a more complete example of how to
> completely implement a checkbox?


If, say, you plan on using a PHP-processed page to handle the form, you
can get good advice in a PHP group, or by searching specifically for
information and PHP and checkbox handling.

--
Ben.
 
Reply With Quote
 
 
 
 
Tim Streater
Guest
Posts: n/a
 
      09-05-2013
In article
<0.ed70957f15cbe5491bc2.20130905111739BST.87mwnrsh (E-Mail Removed)>,
Ben Bacarisse <(E-Mail Removed)> wrote:

> richard <(E-Mail Removed)> writes:
>
> > It's been a long long time since I did anything with checkboxes.
> > So I tried searching on the subject and what did I find?
> > The same damn thing on a few dozen websites.
> > They all show how the code is to be to have a checkbox.
> > Not a damn one of them say how to work with that code.
> > Ok. So you have the checkbox and all the needed information.
> > Now what?

>
> The user submits the form, usually by clicking a "submit" button. What
> happens after this depends on the "action" and "method" attributes in
> of the form in question.


Or you can process it using javascript if you feel like it:

<input type="checkbox" onchange="check(this.checked);"> Some text here


and in your javascript:

var manual_check;

function check (checked)
{
manual_check = checked==true ? 1 : 0;
}



But then none of my forms is ever submitted - the user presses a button,
I encode a number of the variables (including manual_check from the
above) into a string and ajax it to the other side.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
 
Reply With Quote
 
Norman Peelman
Guest
Posts: n/a
 
      09-05-2013
On 09/05/2013 02:02 AM, richard wrote:
> It's been a long long time since I did anything with checkboxes.
> So I tried searching on the subject and what did I find?
> The same damn thing on a few dozen websites.
> They all show how the code is to be to have a checkbox.
> Not a damn one of them say how to work with that code.
> Ok. So you have the checkbox and all the needed information.
> Now what?
> Somewhere, somehow, some action is required to pass the value contained in
> the checkbox to something else.
> But none of these sites explain how this is done.
>
> Anyone have a proper site that gives a more complete example of how to
> completely implement a checkbox?
>


I half-heartedly assume that you know how to put a checkbox in an
HTML page so you will need to post this question in a newsgroup that
deals with the 'pass the value to something else'. It's the 'working
with that code in something else' that needs to be defined.


--
Norman
Registered Linux user #461062
AMD64X2 6400+ Ubuntu 10.04 64bit
 
Reply With Quote
 
Ben Bacarisse
Guest
Posts: n/a
 
      09-05-2013
Tim Streater <(E-Mail Removed)> writes:

> In article
> <0.ed70957f15cbe5491bc2.20130905111739BST.87mwnrsh (E-Mail Removed)>,
> Ben Bacarisse <(E-Mail Removed)> wrote:
>
>> richard <(E-Mail Removed)> writes:
>>
>> > It's been a long long time since I did anything with checkboxes.
>> > So I tried searching on the subject and what did I find?
>> > The same damn thing on a few dozen websites.
>> > They all show how the code is to be to have a checkbox.
>> > Not a damn one of them say how to work with that code.
>> > Ok. So you have the checkbox and all the needed information.
>> > Now what?

>>
>> The user submits the form, usually by clicking a "submit" button. What
>> happens after this depends on the "action" and "method" attributes in
>> of the form in question.

>
> Or you can process it using javascript if you feel like it:
>
> <input type="checkbox" onchange="check(this.checked);"> Some text here


Yes, but i doubt that the OP wants to write a web app!

> and in your javascript:
>
> var manual_check;
>
> function check (checked)
> {
> manual_check = checked==true ? 1 : 0;
> }
>
>
>
> But then none of my forms is ever submitted - the user presses a
> button, I encode a number of the variables (including manual_check
> from the above) into a string and ajax it to the other side.


But then you are probably in control of the user environment. If not,
your forms may well be being submitted (presumably to no effect)!

--
Ben.
 
Reply With Quote
 
Tim Streater
Guest
Posts: n/a
 
      09-05-2013
In article
<0.f8fe5735d6a3ee91eccb.20130905122216BST.87bo47se (E-Mail Removed)>,
Ben Bacarisse <(E-Mail Removed)> wrote:

> Tim Streater <(E-Mail Removed)> writes:
>
> > In article
> > <0.ed70957f15cbe5491bc2.20130905111739BST.87mwnrsh (E-Mail Removed)>,
> > Ben Bacarisse <(E-Mail Removed)> wrote:
> >
> >> richard <(E-Mail Removed)> writes:
> >>
> >> > It's been a long long time since I did anything with checkboxes.
> >> > So I tried searching on the subject and what did I find?
> >> > The same damn thing on a few dozen websites.
> >> > They all show how the code is to be to have a checkbox.
> >> > Not a damn one of them say how to work with that code.
> >> > Ok. So you have the checkbox and all the needed information.
> >> > Now what?
> >>
> >> The user submits the form, usually by clicking a "submit" button. What
> >> happens after this depends on the "action" and "method" attributes in
> >> of the form in question.

> >
> > Or you can process it using javascript if you feel like it:
> >
> > <input type="checkbox" onchange="check(this.checked);"> Some text here

>
> Yes, but i doubt that the OP wants to write a web app!


True but then he's not said what he wants to do.

>
> > and in your javascript:
> >
> > var manual_check;
> >
> > function check (checked)
> > {
> > manual_check = checked==true ? 1 : 0;
> > }
> >
> >
> >
> > But then none of my forms is ever submitted - the user presses a
> > button, I encode a number of the variables (including manual_check
> > from the above) into a string and ajax it to the other side.

>
> But then you are probably in control of the user environment. If not,
> your forms may well be being submitted (presumably to no effect)!


That happens occasionally, but it's a bug if it does. And it is
immediately apparent, as there is a reload (I only ever write <form>). I
seem to recall reading somewhere that I could, in fact, leave out the
<form></form> altogether.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
 
Reply With Quote
 
Denis McMahon
Guest
Posts: n/a
 
      09-05-2013
On Thu, 05 Sep 2013 02:02:11 -0400, richard wrote:

> Anyone have a proper site that gives a more complete example of how to
> completely implement a checkbox?


Is it beyond your capability, in such situations, to write your own quick
form with a checkbox which goes to a php script which simply dumps the
$_POST or $_GET array in a <pre></pre> section.

The following html in checkbox.htm:

<html>
<head>
<title>checkboxes</title>
</head>
<body>
<form method="post" action="checkbox.php">
<p>
Post Checkbox:
<input type="checkbox" name="post_checkbox">
<input type="submit" value="Submit Post Checkbox">
</p>
</form>
<form method="get" action="checkbox.php">
<p>
Get Checkbox:
<input type="checkbox" name="get_checkbox">
<input type="submit" value="Submit Get Checkbox">
</p>
</form>
</body>
</html

The following checkbox.php

<html>
<head>
<title>checkboxes</title>
</head>
<body>
<p>Post Data:</p>
<pre>
<?php
var_dump($_POST);
print_r($_POST);
?>
</pre>
<p>Get Data:</p>
<pre>
<?php
var_dump($_GET);
print_r($_GET);
?>
</pre>
</body>
</html


--
Denis McMahon, http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
Denis McMahon
Guest
Posts: n/a
 
      09-05-2013
On Thu, 05 Sep 2013 18:27:00 +0000, Denis McMahon wrote:

> On Thu, 05 Sep 2013 02:02:11 -0400, richard wrote:
>
>> Anyone have a proper site that gives a more complete example of how to
>> completely implement a checkbox?

>
> Is it beyond your capability ......


On second thoughts, forget I asked that. It was an absolutely stupid
thing to ask given how widely your lack of capability is recognised.

--
Denis McMahon, (E-Mail Removed)
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      09-06-2013
In article <l0b18g$hk7$(E-Mail Removed)>,
Denis McMahon <(E-Mail Removed)> wrote:

> On Thu, 05 Sep 2013 18:27:00 +0000, Denis McMahon wrote:
>
> > On Thu, 05 Sep 2013 02:02:11 -0400, richard wrote:
> >
> >> Anyone have a proper site that gives a more complete example of how to
> >> completely implement a checkbox?

> >
> > Is it beyond your capability ......

>
> On second thoughts, forget I asked that. It was an absolutely stupid
> thing to ask given how widely your lack of capability is recognised.


Perhaps you might consider a third thought, that it was completely and
*unnecessarily* rude.

--
dorayme
 
Reply With Quote
 
Tim Streater
Guest
Posts: n/a
 
      09-06-2013
In article <(E-Mail Removed)>,
dorayme <(E-Mail Removed)> wrote:

> In article <l0b18g$hk7$(E-Mail Removed)>,
> Denis McMahon <(E-Mail Removed)> wrote:
>
> > On Thu, 05 Sep 2013 18:27:00 +0000, Denis McMahon wrote:
> >
> > > On Thu, 05 Sep 2013 02:02:11 -0400, richard wrote:
> > >
> > >> Anyone have a proper site that gives a more complete example of how to
> > >> completely implement a checkbox?
> > >
> > > Is it beyond your capability ......

> >
> > On second thoughts, forget I asked that. It was an absolutely stupid
> > thing to ask given how widely your lack of capability is recognised.

>
> Perhaps you might consider a third thought, that it was completely and
> *unnecessarily* rude.


Well I'm not sure of that. Sometimes its *necessary* to be rude in order
to get a message through. And Dennis's post wasn't even that rude.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IDLE gripe and question Dick Moores Python 3 04-23-2008 05:50 AM
/rant CRAP ADSL /rant XPD NZ Computing 17 04-27-2007 08:00 AM
OT: <Rant> .... </Rant> forum theodore_blovius@yahoo.co.uk Digital Photography 0 02-15-2006 08:39 AM
Gripe: usability problems with directory listing in .Net 2 Tim_Mac ASP .Net 2 12-15-2005 10:37 PM
spam increasing? <rant></rant> T.N.O. NZ Computing 9 11-21-2003 09:57 AM



Advertisments