Form parsing question

  • Thread starter ( ) David De Cristoforo
  • Start date
D

( ) David De Cristoforo

I hope this is the right place to ask this. I have a form with a large
number of list menus. The default value is "0" (zero). Is there any
way to have either the form or the form mail script ignore any of the
list menus that are left at the default value? What I would like is
for the form results to show only the items for which a value other
than "0" has been selected. As it it is right now, the form results
show every item and it's hard to go through the entire list looking
for items that have a value of something other than "0".

Thanx
David DeCristoforo
 
J

Jukka K. Korpela

Scripsit ( ) David De Cristoforo:
I have a form with a large
number of list menus.

Do you have a URL? "List menu" can mean different things.
The default value is "0" (zero).

Maybe, maybe not. Have you set it to be the default?
Is there any
way to have either the form or the form mail script ignore any of the
list menus that are left at the default value?

It depends on what you mean by "are left". You cannot distinguish the
situation where the user intentionally selects "0" from his skipping the
entire question, if "0" is indeed the default (preselected, initial) value.
What I would like is
for the form results to show only the items for which a value other
than "0" has been selected.

Well, it's up to the form handler to do such things. It can ignore the value
of "0", or the value of "42".
As it it is right now, the form results
show every item and it's hard to go through the entire list looking
for items that have a value of something other than "0".

It's impossible to others to see what you are really doing and trying to
accomplish, since you did not post a URL.
 
D

David De Cristoforo

Here is the URL of the form:
http://www.farmerskitchencafe.com/submeals/menu_form.html
Well, it's up to the form handler to do such things. It can ignore the value
of "0", or the value of "42".

That's what I need..for the "form handler" to ignore anything with the
value of "0". In this case the "form handler" is a "typical" form mail
pearl script.
It's impossible to others to see what you are really doing and trying to
accomplish, since you did not post a URL.

Sorry. The URL is above. And thanks for yoiur help.
DD
 
J

Jim Moe

( ) David De Cristoforo said:
I hope this is the right place to ask this. I have a form with a large
number of list menus. The default value is "0" (zero). Is there any
way to have either the form or the form mail script ignore any of the
list menus that are left at the default value?
Since you have to test for those form names in any case, what difference
does it make whether is does not exist or has a default value?
 
D

David De Cristoforo

Since you have to test for those form names in any case, what difference
does it make whether is does not exist or has a default value?

I don't understand what you are asking. Whether what does not exist?
DD
 
J

Jukka K. Korpela

Scripsit David De Cristoforo:
That's what I need..for the "form handler" to ignore anything with the
value of "0". In this case the "form handler" is a "typical" form mail
pearl script.

Unfortunately, a "typical" form mail script is simplistic: it just collects
data and sends it as an e-mail message. But if you have control over the
script (i.e., you can write it or modify it or make someone else to do that
by your wishes), it can of course perform a simple check on any field or on
selected fields, ignoring (for example) fields with a value of 0. It's just
an if statement, or some if statements.

Independently of this, a field for inputting a quantity would probably be
better handled using a text input field rather than <select>. For one thing,
it's faster to type in "1" (or some other number) than to select "1" from a
dropdown list. Moreover, this approach lets any quantity to be entered by
the user. This might be seen as a problem, too: you need to check the input
data in the form handler or elsewhere. But that should be done anyway.

Using text input fields, the problem would be slightly different, though not
more difficult: the form handler's if statement(s) would not check against a
value of "0" but against the empty string "".
 
D

David De Cristoforo

But if you have control over the
script (i.e., you can write it or modify it or make someone else to do that
by your wishes), it can of course perform a simple check on any field or on
selected fields, ignoring (for example) fields with a value of 0. It's just
an if statement, or some if statements.

Ahh, well, therin lies the rub. I am not so gifted though perhaps I
could find someone who was. I was hoping there might be something I
could code into the form that would do this.
Independently of this, a field for inputting a quantity would probably be
better handled using a text input field rather than <select>.
you need to check the input data in the form handler or elsewhere. But that >should be done anyway.

Not a bad idea.

Thanx
DD
 
J

Jukka K. Korpela

Scripsit David De Cristoforo:
I was hoping there might be something I
could code into the form that would do this.

I see. You could use some JavaScript code, invoked via an onsubmit attribute
in the <form> tag, for traversing the form and manipulating the form data
before sending it, removing the redundant fields, but
a) this wouldn't be any easier than modifying a Perl script, in general
b) the redundant fields would not be removed when the user's browser has
JavaScript execution disabled.
 
D

David De Cristoforo

I see. You could use some JavaScript code, invoked via an onsubmit attribute
in the <form> tag, for traversing the form and manipulating the form data
before sending it, removing the redundant fields, but
a) this wouldn't be any easier than modifying a Perl script, in general
b) the redundant fields would not be removed when the user's browser has
JavaScript execution disabled.

Well the JS execution issue is no biggie because this particular
program is pretty much local and we can instruct our customers as to
what they need to do to make it work. We're only talking like 150
people at the most. However, I'm afraid my expertise with Perl and JS
is rudimentary at best so, while I understand what you are saying, I
doubt I have the "where-with-all" to make it work. On the other hand,
what I do know I learned by attempting exactly this kind of
undertaking when I had not a clue what I was doing. Worst that could
happen is that I hose a few scripts right?

Thanx Again
DD
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top