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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.