473,226 Members | 1,319 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

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 2467
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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.