GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   HTML / Programming question for the propellerheads out there.. (https://gfy.com/showthread.php?t=1323208)

2MuchMark 02-13-2020 10:31 PM

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?

myleene 02-14-2020 12:11 AM

Could you use a span?

Demo: https://jsfiddle.net/q390kdLp/

EddyTheDog 02-14-2020 12:34 AM

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

RazorSharpe 02-14-2020 01:10 AM

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;

zerovic 02-14-2020 03:54 AM

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

Coyote 02-14-2020 05:32 AM

Quote:

Originally Posted by 2MuchMark (Post 22608771)
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.

2MuchMark 02-14-2020 07:24 AM

Thank you! will try all ideas today.

machinegunkelly 02-14-2020 08:04 AM

Guys, RTFM.

use .form-control-plaintext

https://getbootstrap.com/docs/4.4/co...nly-plain-text

zerovic 02-14-2020 08:49 AM

Quote:

Originally Posted by machinegunkelly (Post 22608907)
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.

machinegunkelly 02-14-2020 08:59 AM

Quote:

Originally Posted by zerovic (Post 22608942)
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...

zerovic 02-14-2020 09:09 AM

Quote:

Originally Posted by machinegunkelly (Post 22608951)
He's already got bootstrap in his stack...

well then, fair enough :)

machinegunkelly 02-14-2020 01:11 PM

Quote:

Originally Posted by zerovic (Post 22608962)
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. :thumbsup

zeubx 02-14-2020 01:24 PM

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.

blackmonsters 02-14-2020 02:45 PM

<input id="pC" name="pC" type="hidden" value="Blah" >Blah


:2 cents:

2MuchMark 02-16-2020 08:34 AM

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

https://2much.com/gfyimages/1.png

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?

2MuchMark 02-17-2020 01:11 PM

Nothin' ? Nada, zip ?

Coyote 02-17-2020 01:18 PM

Quote:

Originally Posted by 2MuchMark (Post 22609686)
...
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.

zerovic 02-17-2020 01:31 PM

Contacted you on skype.

RyuLion 02-17-2020 01:43 PM

Great ideas already above!! :)


All times are GMT -7. The time now is 01:54 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc