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