Jump to content

need a read only form field


jim.davidson

Recommended Posts

I have a update form and I have a field in that form that I want to display bot not allow the user to update.  I've been searching and everywhere says to use javascript.  I'm not very good with java a could use some guidance.

 

Here's the filed that I want as read only

 

<input value="<?php echo $display_date_written; ?>" name="date_written" type="text" class="text_background" id="date_written" size="10" maxlength="10" />

 

How would I code this?

 

Thanks in advance, any help will be appreciated

Link to comment
https://forums.phpfreaks.com/topic/100209-need-a-read-only-form-field/
Share on other sites

<input value="<?php echo $display_date_written; ?>" name="date_written" type="text" class="text_background" id="date_written" size="10" maxlength="10" readonly="true" />

 

no need for javascript as you can see... there is an atribute for input fields to be readonly

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.