Submitting only CHANGED text boxes

R

rked

I have an order form with about a hundred textboxes saying 0.
People change the zero to something else to tell quantity of field.
I am submitting page via asp and cdo.

Is there a function that detects changed text boxes and will only have
those submitted?

Here is address of page.

http://www.marioncountyfl.org/emsasupplies.htm

I dont want all the non-ordered items showing up in submissal. Thanks!
 
R

RobG

I have an order form with about a hundred textboxes saying 0.
People change the zero to something else to tell quantity of field.
I am submitting page via asp and cdo.

Is there a function that detects changed text boxes and will only have
those submitted?

Here is address of page.

http://www.marioncountyfl.org/emsasupplies.htm

I dont want all the non-ordered items showing up in submissal. Thanks!

Create an onsubmit function that disables all the text inputs that have
a value of '0' - disabled elements are not successful and should not be
submitted by the browser.

Any browser with JavaScript disabled (or without javascript at all)
will submit all the fields regardless. A sample script that will also
disable any empty text element (value = '') is below:

<form name="strBody" onsubmit="disableZeros(this);" ... >
...
</form>

<script type="text/javascript">
function disableZeros(f){
var els = f.elements;
var i=0;
var el = els;

do {
if ('text'==el.type && 0==el.value) el.disabled = true;
} while ( el = els[++i] )

}
</script>
 
R

rked

Thankyou soo much for replying. I works nicely.
Alas, I have run into another condundrum.
I am able to request.form value of field > 0 but is there a way to also
write the field associated with the value submitted? Because all I get
is a list of numbers and not the field names associted with those
values. So instead of
1
2
4
3

I would like

FastPatches (Adult) - 1
FastPatches (Pediatric) - 2
Patient Electrodes (pack) - 4
Pediatric Electrodes - 3

In essence, response.write only those items that have been submitted or
obtained via request.form... i hope this makes sense
 
R

RobG

Thankyou soo much for replying. I works nicely.
Alas, I have run into another condundrum.
I am able to request.form value of field > 0 but is there a way to also
write the field associated with the value submitted? Because all I get
is a list of numbers and not the field names associted with those
values. So instead of
1
2
4
3

I would like

FastPatches (Adult) - 1
FastPatches (Pediatric) - 2
Patient Electrodes (pack) - 4
Pediatric Electrodes - 3

In essence, response.write only those items that have been submitted or
obtained via request.form... i hope this makes sense

At at guess you're talking ASP here? If so, you are more likely to get
a suitable answer in an ASP or server scripting/programming forum.
 
M

Mick White

1
2
4
3

I would like

FastPatches (Adult) - 1
FastPatches (Pediatric) - 2
Patient Electrodes (pack) - 4
Pediatric Electrodes - 3

In essence, response.write only those items that have been submitted or
obtained via request.form... i hope this makes sense

In js, you're looking for:
z= TEXTFIELDOBJECT.parentNode.previousSibling.firstChild
while(z.firstChild)z=z.firstChild;
description=z.data

Pass this along with the qty ordered, store it in a hidden field.

Mick
 
L

Lee

(e-mail address removed) said:
Thankyou soo much for replying. I works nicely.
Alas, I have run into another condundrum.
I am able to request.form value of field > 0 but is there a way to also
write the field associated with the value submitted?

It's a bad idea to make your form submission dependent on client-side
Javascript. Massage the form data however you like on the server side
in your ASP code.
 
M

Mick White

Lee wrote:
....
It's a bad idea to make your form submission dependent on client-side
Javascript. Massage the form data however you like on the server side
in your ASP code.
I agree that SS processing is crucial. Why not simply give form
controls meaningful names?
Mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top