how to assign a php variable to a textfield

mboodhoo
06:03:11
Hello

I have a textfield capa_date_val in my HTML form as follows:

<div style="position:absolute; left: 38%; top:109%; text-align:center; margin:150px auto 100px auto">
<input type="text" id="capa_date_val" name="capa_date_val" maxlength="25" size="25"/>
<img src="images/cal.gif" onclick="NewCssCal('capa_date_val')" style="cursor:pointer"/>
</div>

This field is a date field and next to it there is a javascript calendar image.

Then I have some PHP code on the same page which retrieves some stored values from a database. I would like my PHP code to assign one such value to my capa_date_val text field above.

How do I achieve that?

PHP code (I've omitted the part where I fetch a value from database and assign it to $actn_date variable coz that works fine):
if (isset($actn_date))
{
// assign $actn_date to capa_date_val text field
}
smo1234
06-03-2011
You can assign the variable to the value attribute of the text box. Here is an example of how to assign PHP variable data to a text box.
Please Login to post your reply or start a new topic