473,503 Members | 11,968 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Submitting only CHANGED text boxes

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!

Jul 23 '05 #1
6 1286
rk**@att.net wrote:
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[i];

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

}
</script>

--
Rob
Jul 23 '05 #2
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

Jul 23 '05 #3
rk**@att.net wrote:
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.

--
Rob
Jul 23 '05 #4
rk**@att.net wrote:
[snip] 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


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

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

Mick

Jul 23 '05 #5
Lee
rk**@att.net 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.

Jul 23 '05 #6
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
Jul 23 '05 #7

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

Similar topics

0
1259
by: Suresh Kumaran | last post by:
Hi All, I have a Form which has three tab controls and each tab control has text boxes and combo boxes and Data time picker etc, totalling up to 50 instances in all three tab controls. How do...
12
2051
by: Keith Page | last post by:
I have a page that changes a list of checkboxes based on what city you select, however when i insert the new nodes the values are not submitted when the boxes are checked and form is sent, its like...
1
1962
by: Johnny | last post by:
Hello, I've read somewhere that you can validate form data before actually submitting it, similar to what validation controls would do. For example, I have a form that has 2 textboxes. I...
0
1225
by: Mike Kingscott | last post by:
Totally hacked off here. I've written a user control that contains a text box, a required field validator and a button (these being the cornerstone of a search facility), all as ASP.Net server...
2
4628
by: Syam | last post by:
Hello everyone, I am just barely two months old into learning asp.net and vb.net. Currently I am working on a project to store customer database. I have a question about creating a preview page:...
4
2783
by: Super Steve | last post by:
I'm trying to write a little script that disables the submit button on a form, changes the text of the button, and then submits the form. Can anyone tell me why this works ok: <input...
16
2836
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
1
1999
by: pramodjava | last post by:
i m using struts in my application , i have a struts form tag and three text fields and 2 buttons, one is html:cancel and html:submit cancel button appears first and then submit button. My problem is...
1
1835
by: RP | last post by:
In my Form, I have 20 or 30 Text Boxes and Combo Boxes. I am using a tabbed interface. When the Form's Close button is clicked, I want to check whether user attempted an entry in any of the Text...
0
7212
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
7098
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...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
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
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.