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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-13-2020, 10:31 PM   #1
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 46,503
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?
__________________

VideoChat Solutions | Custom Software | IT Support
https://www.2much.net | https://www.lcntech.com
2MuchMark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 12:11 AM   #2
myleene
Confirmed User
 
Industry Role:
Join Date: Oct 2013
Posts: 858
Could you use a span?

Demo: https://jsfiddle.net/q390kdLp/
myleene is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 12:34 AM   #3
EddyTheDog
Just Doing My Own Thing
 
EddyTheDog's Avatar
 
Industry Role:
Join Date: Jan 2011
Location: London, Spain, New Zealand, GFY - Not Croydon...
Posts: 24,775
Code:
<input id="pC" name="pC" type="text" STYLE="background-color: #A9A9A93"  placeholder="Blah" class="form-control valid" maxlength="10" value="" disabled="disabled">
That should just grey it out - I didn't test it, but I think that will work...

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...
EddyTheDog is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 01:10 AM   #4
RazorSharpe
Confirmed User
 
RazorSharpe's Avatar
 
Industry Role:
Join Date: Aug 2001
Location: Scotland
Posts: 2,237
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.
RazorSharpe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 03:54 AM   #5
zerovic
Confirmed User
 
zerovic's Avatar
 
Industry Role:
Join Date: Apr 2010
Posts: 1,038
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
zerovic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 05:32 AM   #6
Coyote
Drinker of Scotch
 
Industry Role:
Join Date: May 2003
Location: Texas
Posts: 242
Quote:
Originally Posted by 2MuchMark View Post
Tits!

...The user can edit all of the fields except for one.

...What I want to do is just display the data it contains in a plain-ol' format.

Any suggestions?
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.
Coyote is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 07:24 AM   #7
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 46,503
Thank you! will try all ideas today.
__________________

VideoChat Solutions | Custom Software | IT Support
https://www.2much.net | https://www.lcntech.com
2MuchMark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 08:04 AM   #8
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,172
Guys, RTFM.

use .form-control-plaintext

https://getbootstrap.com/docs/4.4/co...nly-plain-text
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 08:49 AM   #9
zerovic
Confirmed User
 
zerovic's Avatar
 
Industry Role:
Join Date: Apr 2010
Posts: 1,038
Quote:
Originally Posted by machinegunkelly View Post
Guys, RTFM.

use .form-control-plaintext

https://getbootstrap.com/docs/4.4/co...nly-plain-text
I'm not a fan of frameworks... especially not bootstrap the replies above are all general solutions and all of them will work.
zerovic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 08:59 AM   #10
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,172
Quote:
Originally Posted by zerovic View Post
I'm not a fan of frameworks... especially not bootstrap the replies above are all general solutions and all of them will work.

He's already got bootstrap in his stack...
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 09:09 AM   #11
zerovic
Confirmed User
 
zerovic's Avatar
 
Industry Role:
Join Date: Apr 2010
Posts: 1,038
Quote:
Originally Posted by machinegunkelly View Post
He's already got bootstrap in his stack...
well then, fair enough
zerovic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 01:11 PM   #12
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,172
Quote:
Originally Posted by zerovic View Post
well then, fair enough
Yea, not really the biggest bootstrap fan myself, but if it's in his stack, which I suspect it is by the class names used on his input, it's best to not re-invent the wheel.
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 01:24 PM   #13
zeubx
Confirmed User
 
zeubx's Avatar
 
Industry Role:
Join Date: Apr 2007
Location: Toulouse
Posts: 48
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.
zeubx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-14-2020, 02:45 PM   #14
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,092
<input id="pC" name="pC" type="hidden" value="Blah" >Blah


__________________
You mad as fuck because you suck.
You have no life.

blackmonsters is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-16-2020, 08:34 AM   #15
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 46,503
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?
__________________

VideoChat Solutions | Custom Software | IT Support
https://www.2much.net | https://www.lcntech.com
2MuchMark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2020, 01:11 PM   #16
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 46,503
Nothin' ? Nada, zip ?
__________________

VideoChat Solutions | Custom Software | IT Support
https://www.2much.net | https://www.lcntech.com
2MuchMark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2020, 01:18 PM   #17
Coyote
Drinker of Scotch
 
Industry Role:
Join Date: May 2003
Location: Texas
Posts: 242
Quote:
Originally Posted by 2MuchMark View Post
...
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?
See my previous comment.
__________________
Ethernet Servers

Quote:
CS: Linux can pretty much run on a potato. Which is a GOOD thing.
Coyote is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2020, 01:31 PM   #18
zerovic
Confirmed User
 
zerovic's Avatar
 
Industry Role:
Join Date: Apr 2010
Posts: 1,038
Contacted you on skype.
zerovic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2020, 01:43 PM   #19
RyuLion
 
RyuLion's Avatar
 
Industry Role:
Join Date: Mar 2003
Location: San Diego
Posts: 32,084
Great ideas already above!!
__________________

Adult Biz Consultant A tech head since 1995
RyuLion is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
fields, data, field, plain-ol, editable, format, suggestions, change, display, users, edit, web, page, tits, programming, question, propellerheads, bunch, html, user, populated



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.