My input field has 2 state. If the user don't scroll the page or the page is in the homes page, the value of the input field is empty. When user starts scrolling, the value will be filled.

My problem is when I scroll, the text inside the input field disappears.
You will understand if you'll go to this test link http://webtest.callumcreative.com/silvercreek/

If you want to see my code, go to the footer and check for the "functions.js" file.

Pls help. I'm almost giving up thinking of its logic.

Thank you

Recommended Answers

All 5 Replies

You're using HTML5 why not simply add a placeholder attribute to the input field and remove the js?

<input class="subscribe-input" type="text" value="" name="email" placeholder="Enter email to receive updates">

Simply because I cannot make it work in IE. But thats not the real problem. My problem is when you input your email inside the input field, then you suddenly scroll down the page, the text inside the input field resets and goes back to "Enter email to receive updates". Same as when you scroll up the page. Then email value has 2 state.

You need to stop changing the value of the input field when the user scrolls.

Simply replace your placeholder code for this jQuery plugin.

I'm not sure if I can stop changing the values as that's a client request. I hope there are still other way..

Change the "other" values - stop overwriting the input value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.