473,472 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Changing form's field input type

Hi all,
We have the form which uses checkboxes for several fields and the target
action points to outside webservice. Unfortunatelly they do not support
checkboxes. How to pass it as a radio buttons or pull down select box with
Yes/No options for example (which they support) using still checkboxes as an
input entry.
Thank you for any hint,
emanuel
Jul 17 '05 #1
3 2476
On Mon, 8 Mar 2004 10:12:37 -0500, "Emanuel Marciniak"
<em********@patientcare.com> wrote:
Hi all,
We have the form which uses checkboxes for several fields and the target
action points to outside webservice. Unfortunatelly they do not support
checkboxes. How to pass it as a radio buttons or pull down select box with
Yes/No options for example (which they support) using still checkboxes as an
input entry.
Thank you for any hint,
emanuel


Server-side there are no such things as "checkboxes" or "radio
buttons". All <input>s submit themselves as name/value pairs. A
server-side script cannot determine what type of form element was
used.

If you want a checkbox to submit the value "yes", use:
<input type='checkbox' name='whatever' value='yes'>

Checkboxes don't submit a value if they're unselected. This may be the
problem you're having. If it is, then other than using Javascript
client-side (not recommended), I can't see a way around it.

--
David ( @priz.co.uk )
Jul 17 '05 #2
David Mackenzie wrote:

On Mon, 8 Mar 2004 10:12:37 -0500, "Emanuel Marciniak"
<em********@patientcare.com> wrote:
Hi all,
We have the form which uses checkboxes for several fields and the target
action points to outside webservice. Unfortunatelly they do not support
checkboxes. How to pass it as a radio buttons or pull down select box with
Yes/No options for example (which they support) using still checkboxes as an
input entry.
Thank you for any hint,
emanuel


Server-side there are no such things as "checkboxes" or "radio
buttons". All <input>s submit themselves as name/value pairs. A
server-side script cannot determine what type of form element was
used.

If you want a checkbox to submit the value "yes", use:
<input type='checkbox' name='whatever' value='yes'>

Checkboxes don't submit a value if they're unselected. This may be the
problem you're having. If it is, then other than using Javascript
client-side (not recommended), I can't see a way around it.


Actually, I wonder if he could make the page submit to itself, make sure there
are variable="no"'s whereever there aren't variable="yes"'s upon submit, then
redirect the page to the outside webservice. This would take a bit longer and
probably wouldn't work for POST (at least without re-prompting the user about
resending the data).

Or, he could make his custom form, submit it to his server and have the server
submit it to the outside web service. On completion he could send a
success/error message to the user. This would take even longer, though, and
could cause problems if the outside web service logs/blocks IPs to prevent
spamming, etc.

Both of these options assume he has access to PHP, which may be an incorrect
assumption.

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #3
Dave, Shawn - thank you for your comments.
Yes I do have an access to PHP. I think I will play with Shawn's first
option. (resubmitting will be just another form with fields filled-up with
user's original entry - if ok then submit to webservice if not then refresh
an original form). PHP if statement will check value/name of 'checkbox' and
submit corresponding value/name of 'radio button'.
thank you
emanuel

"Shawn Wilson" <sh***@glassgiant.com> wrote in message
news:40***************@glassgiant.com...
David Mackenzie wrote:

On Mon, 8 Mar 2004 10:12:37 -0500, "Emanuel Marciniak"
<em********@patientcare.com> wrote:
Hi all,
We have the form which uses checkboxes for several fields and the targetaction points to outside webservice. Unfortunatelly they do not support
checkboxes. How to pass it as a radio buttons or pull down select box withYes/No options for example (which they support) using still checkboxes as aninput entry.
Thank you for any hint,
emanuel
Server-side there are no such things as "checkboxes" or "radio
buttons". All <input>s submit themselves as name/value pairs. A
server-side script cannot determine what type of form element was
used.

If you want a checkbox to submit the value "yes", use:
<input type='checkbox' name='whatever' value='yes'>

Checkboxes don't submit a value if they're unselected. This may be the
problem you're having. If it is, then other than using Javascript
client-side (not recommended), I can't see a way around it.


Actually, I wonder if he could make the page submit to itself, make sure

there are variable="no"'s whereever there aren't variable="yes"'s upon submit, then redirect the page to the outside webservice. This would take a bit longer and probably wouldn't work for POST (at least without re-prompting the user about resending the data).

Or, he could make his custom form, submit it to his server and have the server submit it to the outside web service. On completion he could send a
success/error message to the user. This would take even longer, though, and could cause problems if the outside web service logs/blocks IPs to prevent
spamming, etc.

Both of these options assume he has access to PHP, which may be an incorrect assumption.

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joe | last post by:
having this script: ------------------------------------------------------------------- <script language="JavaScript" type="text/javascript"> <!-- function isanumber() { var antal =...
12
by: szar | last post by:
I'm passing numerous array elements called list when a form is submitted. the brackets are necessary for PHP to see all the values as an array. The problem is I can't seem to reference the form...
4
by: multimatum2 | last post by:
Hello, I need to enable/disable input text forms... But... I need to have the same style (color...) in both modes.. Could you help me ? Thanx a lot A small sample... ...
8
by: Ryan | last post by:
I have a hidden field as such: <INPUT TYPE=\"hidden\" name=xmlfield > I have a button that i want to use to call a function to change the value: <INPUT TYPE=submit VALUE="Display XML"...
8
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care...
5
by: Good Man | last post by:
Hi there I'm adding form fields on the fly with some javascript DOM programming. I basically just clone a hidden <div>, then adjust node properties to make this new <div> have unique values...
2
by: yawnmoth | last post by:
Say I have two input elements and that I wanted to make it so that when the first ones input was what it should be, the focus would automatically be shifted to the next input element. ie....
2
by: Cerebral Believer | last post by:
Hi folks, Can anyone help me with this form: http://futurebydesign-music.com/_member/club_fbd_reg.php I have followed to coding instructions aas closely as I can, but I am getting errors...
1
by: peck2000 | last post by:
Related to my earleir post ... this is the same project to re-purpose the Classifieds application in BEGINNING ASP 3.0 (Wrox) to a comicbook database ... This is a brainteaser that should have...
2
by: sbettadpur | last post by:
Hi everybody, Hi iam strugling with more than one submit buttons with in one form here is my code <form method="post" action="Offer.php" name='issueFrm' onSubmit="return fullOfferfields();">...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.