|   |   |   | ||||
| Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. | 
|    | 
| 
 | |||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. | 
|  | Thread Tools | 
|  02-13-2020, 10:31 PM | #1 | 
| Videochat Solutions Industry Role:  Join Date: Aug 2004 Location: Canada 
					Posts: 49,433
				 | 
				
				HTML / Programming question for the propellerheads out there..
			 Tits! I have a web page with a bunch of fields on it. The data in the fields are populated from a DB. The user can edit all of the fields except for one. That field looks like this: <input id="pC" name="pC" type="text"placeholder="Blah" class="form-control valid" maxlength="10" value="" disabled="disabled"> The problem is that this LOOKS like an editable field so users try to change the value. What I want to do is just display the data it contains in a plain-ol' format. Any suggestions? 
				__________________ | 
|   |           | 
|  02-14-2020, 12:11 AM | #2 | 
| Confirmed User Industry Role:  Join Date: Oct 2013 Location: Canada 
					Posts: 894
				 | |
|   |           | 
|  02-14-2020, 12:34 AM | #3 | 
| Just Doing My Own Thing Industry Role:  Join Date: Jan 2011 Location: London, Spain, New Zealand, GFY - Not Croydon... 
					Posts: 25,207
				 | Code: <input id="pC" name="pC" type="text" STYLE="background-color: #A9A9A93" placeholder="Blah" class="form-control valid" maxlength="10" value="" disabled="disabled"> That would be the standard way of indicating a text field is not editable - You can see 'blablah'..... https://jsfiddle.net/bwh0cnme/ I always forget about jsfiddle... | 
|   |           | 
|  02-14-2020, 01:10 AM | #4 | 
| Confirmed User Industry Role:  Join Date: Aug 2001 Location: Scotland 
					Posts: 2,238
				 | Change the css on the disabled selector.  For example: .form-control:disabled, .form-control[readonly] You'll likely have a background colour attached to it - remove it. Add in: border: none; 
				__________________ Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. | 
|   |           | 
|  02-14-2020, 03:54 AM | #5 | 
| Confirmed User Industry Role:  Join Date: Apr 2010 
					Posts: 1,107
				 | Hi, disabled fields should be greyed out automatically by most modern browsers, however you can simply add a css rule for the disabled input fields like input:disabled { background:#f0f0f0; } cheers, z | 
|   |           | 
|  02-14-2020, 05:32 AM | #6 | 
| Drinker of Scotch Industry Role:  Join Date: May 2003 Location: Texas 
					Posts: 242
				 | If all you want is to display the data, get rid of the input field since the data does not change. Instead, style a text element (P, span, div, etc.) and place it in the proper position on your form. 
				__________________ Ethernet Servers Quote: CS: Linux can pretty much run on a potato. Which is a GOOD thing. | 
|   |           | 
|  02-14-2020, 07:24 AM | #7 | 
| Videochat Solutions Industry Role:  Join Date: Aug 2004 Location: Canada 
					Posts: 49,433
				 | Thank you! will try all ideas today. 
				__________________ | 
|   |           | 
|  02-14-2020, 08:49 AM | #9 | |
| Confirmed User Industry Role:  Join Date: Apr 2010 
					Posts: 1,107
				 | Quote:  the replies above are all general solutions and all of them will work. | |
|   |           | 
|  02-14-2020, 09:09 AM | #11 | 
| Confirmed User Industry Role:  Join Date: Apr 2010 
					Posts: 1,107
				 | |
|   |           | 
|  02-14-2020, 01:24 PM | #13 | 
| Confirmed User Industry Role:  Join Date: Apr 2007 Location: planet earth 
					Posts: 50
				 | Bootstrap and javascript are not a solution. I can post a lot query using curl in command line. Fix your pĥp script, this is the right way. | 
|   |           | 
|  02-14-2020, 02:45 PM | #14 | 
| Making PHP work Industry Role:  Join Date: Nov 2002 Location: 🌎🌅🌈🌇 
					Posts: 20,621
				 | <input id="pC" name="pC" type="hidden" value="Blah" >Blah  | 
|   |           | 
|  02-16-2020, 08:34 AM | #15 | 
| Videochat Solutions Industry Role:  Join Date: Aug 2004 Location: Canada 
					Posts: 49,433
				 | Thanks for the suggestions, but none of them did what I was looking for.  Here's a better description of the problem. I have form that people can access and modify as they need to. One of the form elements is a commission field, that they cannot edit. It looks like this  The code that displays it looks like this <input id="Commission" name="Commission" type="text" placeholder="Commission" class="form-control valid" maxlength="10" value="" disabled="disabled"> Input for this field is already disabled and that's fine, it works, but it still LOOKS like a field that can be edited. All I really want it to say is "Commission: 50%" How do I simply show the value of "Commission" without making it an input field? 
				__________________ | 
|   |           | 
|  02-17-2020, 01:11 PM | #16 | 
| Videochat Solutions Industry Role:  Join Date: Aug 2004 Location: Canada 
					Posts: 49,433
				 | Nothin' ? Nada, zip ? 
				__________________ | 
|   |           | 
|  02-17-2020, 01:18 PM | #17 | 
| Drinker of Scotch Industry Role:  Join Date: May 2003 Location: Texas 
					Posts: 242
				 | See my previous comment. 
				__________________ Ethernet Servers Quote: CS: Linux can pretty much run on a potato. Which is a GOOD thing. | 
|   |           | 
|  02-17-2020, 01:31 PM | #18 | 
| Confirmed User Industry Role:  Join Date: Apr 2010 
					Posts: 1,107
				 | Contacted you on skype. | 
|   |           | 
|  02-17-2020, 01:43 PM | #19 | 
| Industry Role:  Join Date: Mar 2003 Location: San Diego 
					Posts: 32,273
				 | Great ideas already above!!   
				__________________ | 
|   |           |