By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,643 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,643 IT Pros & Developers. It's quick & easy.

Submitting Form Var Problem

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.