PHP Classes

Default value of text fields?

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  Default value of text fields?  >  (Un) Subscribe thread alerts  
Subject:Default value of text fields?
Summary:Is there a way to load the text fields with a default value?
Messages:3
Author:ffff
Date:2007-07-08 19:10:51
Update:2007-07-08 19:43:11
 

  1. Default value of text fields?   Reply   Report abuse  
Picture of ffff ffff - 2007-07-08 19:10:51
There is a basic functionality that I do not see implemented in the class. How can I specify a default value for a text field?.

For example: I declare a text field and I want to have the text: "xxxx" written in it when the form loads.

Why would I need that?

Because in a form to edit user details, all the fields should be loaded with the values already stored in the database.

  2. Re: Default value of text fields?   Reply   Report abuse  
Picture of ffff ffff - 2007-07-08 19:28:08 - In reply to message 1 from ffff
I found out that the "VALUE" attribute does this. BUT I think I have found a bug:

**BUG** When the VALUE of a text field is declared and the field is displayed as readOnly, the value of the field is not displayed. (I am using the automatic vertical layout)

  3. Re: Default value of text fields?   Reply   Report abuse  
Picture of ffff ffff - 2007-07-08 19:43:11 - In reply to message 2 from ffff
Oh please ignore this message. I do not know what happened but everything is working fine now. I wish there was a delete option for the messages posted.