Hello to all,
I am updating a dropdown option field. But when i choose "Close" option then a textbox field with the current date appears.
Below is the code for it:

PHP Code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>

$(document).ready(function () {
            $('#status').change(function () {
                if (this.value == "Close") {
                } else {


<form action="status2.php" method="post">
<select id="status" name="status" value="<?=$row['status']?>">
                        <option value="Open">Open</option>
                        <option value="Inprocess">Inprocess</option>
                        <option value="Close">Close</option>
             <tr id="Other" style="display: none">
                   <!-- <input id="txtOthers" type="text" /> -->
                   <label>Lead Close Date :&nbsp; <input type="text"  name="lead_close" value="<?php $b time ();
date("d-m-y",$b) ; 
?> "  ><br />

<input type="submit" value="Update" name="submit">
The above code works perfectly fine.
But when i update the records then even the hide textbox(lead_close) gets update. It must only update when the close option gets selected orelse only status with "Open" or "Inprocess" must update.
Below is my update code:

PHP Code:
mysql_connect("localhost","root","") or die("Cannot connect to server");
mysql_select_db("test",$konek) or die("Cannot connect to the database");

$status= ($_POST['status'])?$_POST['status']:'';

$lead_close= ($_POST['lead_close'])?$_POST['lead_close']:'';

mysql_query("update public set status='".$status."', lead_close='".$lead_close."' where id='1'");
I dont know where i am missing it.
Just need some correction in my code.
Thanks in advance.