Jump to content

dropdown list problem urgent help needed pls


helloise
 Share

Recommended Posts

the line : echo $form['catcher_id'] gives me a dropdown list which was defined in a base class as: 'catcher_id' => new sfWidgetFormPropelChoice(array('model' => 'LpmCatcher', 'add_empty' => false)),when i choose another item from the dropdown i want to do a few things but my code not working: $selected_catcher = $form['catcher_id']; foreach($selected_catcher as $val) { $catcher_name = $val->getName(); echo $catcher_name." ".$val->getId(); if ($catcher_name = "zed-catcher") { echo $form['service_code']->renderLabel(); echo $form['service_code']->renderError(); echo $form['service_code']; } }please help?thanks

Edited by helloise
Link to comment
Share on other sites

You need to use "==" to compare values, the "=" operator sets a value, it does not compare. If that doesn't help, show the rest of the code. That type of code will only work if they select a value and then submit the form, but it doesn't look like you're getting the value they picked.

Link to comment
Share on other sites

You need to use "==" to compare values, the "=" operator sets a value, it does not compare. If that doesn't help, show the rest of the code. That type of code will only work if they select a value and then submit the form, but it doesn't look like you're getting the value they picked.
no i am not getting the value i picked and yes sorry it should be "==" :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...