473,385 Members | 2,044 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,385 software developers and data experts.

Submitting Form Var Problem

I have two dropdown list:

frm_cbo_top

frm_cbo_bottom
I have an OnChange="submit_form();" in each of these dropdown lists -
the javascript does a form.submit() call

The problem is that the post .php file which gets called *always*
catches this line:

if ($frm_cbo_top)
{
// do some work
}

Even when I make a selection in the bottom dropdown object the
$frm_cbo_top var if statement is active because the code flow goes
into the section - I want the $frm_cbo_bottom to catch is I select
that dropdown and the $frm_cbo_bottom to catch if I select that
dropdown - what am I missing here?

Thanks...
Jul 17 '05 #1
1 1759
jn
"Ralph Freshour" <ra***@primemail.com> wrote in message
news:us********************************@4ax.com...
I have two dropdown list:

frm_cbo_top

frm_cbo_bottom
I have an OnChange="submit_form();" in each of these dropdown lists -
the javascript does a form.submit() call

The problem is that the post .php file which gets called *always*
catches this line:

if ($frm_cbo_top)
{
// do some work
}

Even when I make a selection in the bottom dropdown object the
$frm_cbo_top var if statement is active because the code flow goes
into the section - I want the $frm_cbo_bottom to catch is I select
that dropdown and the $frm_cbo_bottom to catch if I select that
dropdown - what am I missing here?

Thanks...


frm_cbo_top is being submitted in the form with the value currently
selected, even if you use the bottom select box.

Give frm_cbo_top an empty default selected value:

<OPTION VALUE="" SELECTED>Select a value</OPTION>

and test for that in PHP:

if($frm_cbo_top != '')

HTH
Jul 17 '05 #2

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

Similar topics

0
by: Duke Hamacher | last post by:
Hello: This title is a little ambiguous but this is an interesting puzzle. Lets's say we have a JSP page with a form. The ActionForm associated with this form has, say, 4 String properities. ...
1
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your...
2
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
1
by: Richard Dixson | last post by:
I have code that calls document.myFormName.submit() to submit a form automatically via JavaScript. This works just fine. However, if there is a button (or other form field element) on the form...
14
by: threeflush | last post by:
I'm supporting an ASP legacy application and need to implement "autosave" functionality. I have two frames, one that holds tabs displaying different pages a user can select, and the other that...
5
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post...
16
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...
18
by: NavinM | last post by:
I have a couple of forms that are misbehaving in FireFox, but work fine in IE. when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the...
1
by: philguenet | last post by:
I have left my Web site out at my provider for a long while. Yesterday I tried changing quite a few things on it but it all ended in tears. None of the form submit button submit anymore. I am...
6
by: phpnewbie26 | last post by:
This has been confusing me for a while. I don't understand why it isn't working. In my original coding, I have an action called submitted.php and this is what is looks like: <?php ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...

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.