jim.davidson Posted April 8, 2008 Share Posted April 8, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/100209-need-a-read-only-form-field/ Share on other sites More sharing options...
lewis987 Posted April 8, 2008 Share Posted April 8, 2008 <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 Quote Link to comment https://forums.phpfreaks.com/topic/100209-need-a-read-only-form-field/#findComment-512409 Share on other sites More sharing options...
Psycho Posted April 8, 2008 Share Posted April 8, 2008 no need for javascript as you can see... there is an atribute for input fields to be readonly Yes, especially since JavaScript can be disabled! Quote Link to comment https://forums.phpfreaks.com/topic/100209-need-a-read-only-form-field/#findComment-512428 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.