[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PHP Code Help

Posted on 2014-08-15
5
Medium Priority
?
248 Views
Last Modified: 2014-08-15
This code pulls data from my mysql database & displays it in a form...how can I make it read only?

<td> <b> Due Date:  </b><br><input type="text" name="datepicker" size="15" maxlength="30" value="'.$row[3].'" /> </td>

Open in new window

0
Comment
Question by:wantabe2
  • 2
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
Edward Cho earned 2000 total points
ID: 40262977
Try using input disabled.

<td> <b> Due Date:  </b><br><input disabled type="text" name="datepicker" size="15" maxlength="30" value="'.$row[3].'" /> </td>

Open in new window

0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40262984
Disabled controls won't be submitted to the server on a form submit, so you may want to use readonly instead.
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 40263182
My two cents about: kaufmed solution seems to be the best: it prevents to modify data but it still submits them and allows to move info forward. I seriously think you have to request attention and modify your choice: you at least shour split points between between Edward Cho and kaufmed.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40263198
@Marco

It's cool. My comment got posted after he had already accepted. And he may not need to submit the input--that's unclear from his question.
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 40263218
@kaufmed: it's clear, that were only my two cents :-) Since I read the thread more than an hour after it was closed, I had the full view of the possible answers and I told my opinion: it was not requested but I couldn't resist ;-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses
Course of the Month19 days, 13 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question