Jump to content

empty Dropdown value


mattichu

Recommended Posts

how would I make it so that the option 'Remove (make blank)' would post an empty value?

 

<form action="/new/newrotastaffprocess.php" Method="POST">

 

<select name="username">

<?php

$result = mysql_query("SELECT * FROM members")

or die(mysql_error());

while($row = mysql_fetch_array( $result )) {

 

echo "<option value=\"" . htmlentities($row["username"]) . "\">" . htmlentities($row["username"]) . "</option>";

}

echo "<option value='empty'>Remove (make blank)</option>";

?>

</select>

</div>

<div style="position:absolute; top:397px; left:570px;">

<form action="/new/newrotastaffprocess.php" METHOD="POST">

<input type = "hidden" value="<?php echo $wkbeg;?>" name="wkbeg">

<input type = "hidden" value="<?php echo $staffno;?>" name="staffno">

<input type = "submit" value="New!">

</form>

Link to comment
https://forums.phpfreaks.com/topic/253438-empty-dropdown-value/
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.