PHP Classes

Read-only field

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  >  Read-only field  >  (Un) Subscribe thread alerts  
Subject:Read-only field
Summary:Why is this summary field mandatory???
Messages:4
Author:Shmuel
Date:2008-11-16 11:56:09
Update:2008-11-18 08:03:55
 

  1. Read-only field   Reply   Report abuse  
Picture of Shmuel Shmuel - 2008-11-16 11:56:09
Hi,

How can I make an input field read-only (just one field, not the whole form)?

Thanks,
Shmuel

  2. Re: Read-only field   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-11-16 23:38:31 - In reply to message 1 from Shmuel
You can just add the input setting the ReadOnly attribute.

  3. Re: Read-only field   Reply   Report abuse  
Picture of Shmuel Shmuel - 2008-11-17 09:15:27 - In reply to message 2 from Manuel Lemos
Hi,

I'm quite new to this, so could you please provide
a code for working example. Couldn't find it in the examples
provided with the class.

Thanks,

Shmuel

  4. Re: Read-only field   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-11-18 08:03:55 - In reply to message 3 from Shmuel
It is easy, just add an entry in the array that is passed to AddInput like this:

$form->Addinput(array(

... some attributes ...

'ReadOnly'=>1

));