Jump to content

dropdown list problem urgent help needed pls


helloise

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...