Jump to content

Form ??


czukoman20

Recommended Posts

<tr><td>Type of Market:</td>
  <td><label>
    <select name="type_market" id="type_market">
      <option value="stocks">Stocks </option>
      <option value="commodities">Commodities</option>
      <option value="education">Education</option>
      <option value="planning">Planning</option>
      <option value="morgage_broker">Morgage broker</option>
              </select>
  </label></td>

 

That is my list form ... i am wondering how could i make it so when the user goes to edit account.. how can i make it so it echos $req_user_info['type_market']; (market type variable that i created)

and display that area of the drop down menu ?

 

for example how you have for a text field

<tr><td>Comments To the Banner owners. :</td><td><textarea name="comments" cols="40" rows="5">
<? echo $req_user_info['comments']; ?></textarea></td><td><? echo $form->error("comments"); ?></td></tr>
<tr><td colspan="2" align="right">

 

<? echo $req_user_info['comments'];  shows what the user already has in their database

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/81978-form/
Share on other sites

Is this what you are looking for ?

 

<?php
$type_market = $req_user_info['type_market'];
?>
<select name="type_market" id="type_market">
<option value="stocks" <?php if($type_market=="stocks") echo "selected"; ?>>Stocks </option>
<option value="commodities" <?php if($type_market=="commodities") echo "selected"; ?>>Commodities</option>
<option value="education" <?php if($type_market=="education") echo "selected"; ?>>Education</option>
<option value="planning" <?php if($type_market=="planning") echo "selected"; ?>>Planning</option>
<option value="morgage_broker" <?php if($type_market=="morgage_broker") echo "selected"; ?>>Morgage broker</option>
</select>

Link to comment
https://forums.phpfreaks.com/topic/81978-form/#findComment-416569
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.