As David already said, create an hidden input element:

        <input type="hidden" name="frm_requestmailing" >

Of cause, your checkbox needs to have another name then (or no name, but an
id, so you can use getElementById to get the value of the checkbox).

Next, on your check box, attach a JavaScript program that modifies the value
of the input according the setting of the checkbox. I think, it's the
onclick method, but I'm not sure if onclick is triggered "on mouse down" or
"on mouse up".

When you submit this form, the value of frm_requestmailing will be
delivered.


  Peter

> 
> Hi
> 
> I was wondering if people might post their suggestions for capturing  
> form data when the <input> tag is a checkbox. In this case case the  
> server has no way of knowing that the checkbox was on the 
> form because  
> the browser doesn't include the checkbox in the request if it's not  
> checked.
> 
> In this particular application, provision is made for end users to  
> create their own data capture forms, place them on the server and  
> either email the submissions to central command or write them to a  
> text file.
> 
> The web application uses the key/value pairs to list the data either  
> in the email body, e.g.:
> 
> frm_surname: Pike
> frm_firstname: Magnus
> 
> etc.
> 
> Where checkboxes are concerned they would like to see:
> 
> frm_requestmailing: No
> 
>   . . . instead this line omitted because the browser simply doesn't  
> sent any value for an unchecked checkbox and the server doesn't know  
> the form structure so it can't 'inject' the key/value pair itself.
> 
> One workaround is to use 'yes-no' radio buttons, but the customer  
> would prefer checkboxes simply because their customers do.
> 
> Any tips on dealing with this would be appreciated.
> 
> Peter
> 


-- 
---------------------------------------------------------------------
Angaben gemäß §35a GmbH-Gesetz:
ITServ GmbH
Sitz der Gesellschaft: 55294 Bodenheim/Rhein
Eingetragen unter der Registernummer HRB 41668 beim AG Mainz
Vertretungsberechtigter Geschäftsführer: Peter Bauer
Umsatzsteuer-ID: DE182270475
---------------------------------------------------------------------

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to