Hey there. I'm a bit of a noob so I apologize if this is an obvious question. I am trying to query a database based on the chose from a drop down menu in the same form so it looks like this.
<?php
if(dropDownOption === 0)
return array("Author" => $form->data("userinputfindabook"));
if(dropDownOption === 1)
return array("book title" => $form->data("userinputfindabook"));
if(dropDownOption === 2)
return array("ISBN" => $form->data("userinputfindabook"));
?>
The problem is I don't know how to write the condition of the if statement.
<?php
if(dropDownOption === 0)
return array("Author" => $form->data("userinputfindabook"));
if(dropDownOption === 1)
return array("book title" => $form->data("userinputfindabook"));
if(dropDownOption === 2)
return array("ISBN" => $form->data("userinputfindabook"));
?>
The problem is I don't know how to write the condition of the if statement.
Hi,
It should be like this:
Regards,
Max
It should be like this:
<?php
if($form->data("dropdown_field_name") == 0){
return ...
}else if($form->data("dropdown_field_name") == 1){
return ...
}else if($form->data("dropdown_field_name") == 2){
return ...
}
Regards,
Max
Cheers!
This topic is locked and no more replies can be posted.