Jump to content

HELP with hiding a field on screen...


rsammy

Recommended Posts

Can someone help me please???????

i am trying to hide a field on screen. But, I need to default it to a value that I will be using to populate the database. I tried some ways but am not successful here.

This is the original code:

<tr>
<td width="275"><div align="right"><font class="inputLbl">Registered Client: &nbsp;</font> </div></td>

<td colspan="2"><? $queryclient="SELECT client_name, client_id FROM clients";
$resultclient= mysql_query($queryclient);
if ($resultclient)
//if (mysql_num_rows($resultclient) != 0)
{
    //print ("<select name='client_id'>");
    print ("<select name='ClientName'>");
    if ($row = mysql_fetch_array($resultclient))
    {
do
{
    print("<option value=\"");
    echo $row["client_name"];
    if ($row["client_name"]== $client_name)
    {
print("\" selected>");
    }
    else
    {
          print("\">");
    }
    print $row["client_name"];
    print("</option>");
//}
}
while($row = mysql_fetch_array($resultclient));
        }
  }
  print ("</select>");
?></td>
</tr>

This code displays the value as a drop down box. it has 3 values in the database table and it displays them.  I dont want this now. What I now need is to default this field to one particular value from the drop down. i will need to pass this value to a variable or something so I can save it in the db table.

I am trying to do somethign like this ...

<tr>
  <td width="283"> <div align="right"><font class="inputLbl">
  <input type="hidden" name="Client_Name" value="<?

                                print ("$xxxxxxxx"); ?>">                     
  </font></div></td>
  <td colspan="2">&nbsp;</td>
</tr>

$xxxxxxxx could be the default value, say 'Group'. I need it to point to Group to be able to insert it into the db table.

Please help me guys...
Link to comment
https://forums.phpfreaks.com/topic/26392-help-with-hiding-a-field-on-screen/
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.