1 Replies - 1225 Views - Last Post: 30 November 2012 - 01:00 AM

#1 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

saveing data from a drop down(select option)

Posted 30 November 2012 - 12:47 AM

if i want to save value from text field i can do this and it works fine.

<input type="text"  name="price" id="price"
  value="<?php if(isset($_POST['price'])){echo htmlentities($_POST['price']);}?>" />



but how can i save value from drop down menu.

<select>
      
<option name="hair_care" 
value="<?php if(isset($_POST['hair_care'])){echo htmlentities($_POST['hair_care']);}?>"> Hair Care</option>

</select>


Is This A Good Question/Topic? 0
  • +

Replies To: saveing data from a drop down(select option)

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3521
  • View blog
  • Posts: 10,163
  • Joined: 08-June 10

Re: saveing data from a drop down(select option)

Posted 30 November 2012 - 01:00 AM

you set the selected attribute.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1