Placeholder question - Post ID 207080

User 2495268 Photo


Registered User
8 posts

I have a very small form, with the following place holders.

Name:
Phone Number:
Email:
Services You Require:

The client wants the placeholders to be static. As in.... When a customer of theirs goes to fill it out. The cursor starts after the colon and all of the place holders stay in the fields.

Why they want this? I have no idea.

Can this be done?

Thank you
User 187934 Photo


Senior Advisor
20,271 posts

A little J-Query or JavaScript should be able to handle this.:cool:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2495268 Photo


Registered User
8 posts

Hi Eric, unfortunately I wouldn't know where to begin creating the script. Where it would be added or how to implement. There are a lot of files created when the finished product is uploaded.

Any ideas?

Thanks
User 187934 Photo


Senior Advisor
20,271 posts

Can you provide me with your form html, or a link to your form?:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2495268 Photo


Registered User
8 posts

You're going to laugh. The form is on the same page as their contact form which is on every page on their site. It's in the main content area not the sidebar. Thanks for having a look.

http://www.romanandsons.com/pricing.php

User 187934 Photo


Senior Advisor
20,271 posts

I'm only providing what you asked for.:) I'm not going to determine if it's right or wrong.
For your phone number add this to the code for the input. You'll have to change all of your inputs to plain text fields so the validation won't trip up.;) I think you can figure the other ones. Just change the words.

value="Phone Number:" onfocus="this.value = this.value=='Phone Number:' ? 'Phone Number:' : this.value; " onfocusout="this.value = this.value == 'Phone Number:' ? this.value = 'Phone Number:' : this.value; this.value=='Phone Number:' ? "

So you'll end up looking similar to this.
<input name="text3" id="item3_text_1" type="text" maxlength="254" placeholder="" value="Phone Number:" onfocus="this.value = this.value=='Phone Number:' ? 'Phone Number:' : this.value; this.style.color='#000';" onfocusout="this.value = this.value == 'Phone Number:' ? this.value = 'Phone Number:' : this.value; this.value=='Phone Number:' ? this.style.color='#000' : this.style.color='#000'"
data-hint="" autocomplete="off" />
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2495268 Photo


Registered User
8 posts

I'll give it a shot, thank you Eric!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.