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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.