Frage

i have this website im building, my client is using a template and the template has contact forms, now i cant seem to understand how to get the text fade on click for input fields to work on any additional fields i make on top of what was there on the template.

http://daniloportal.com/NPC2/contact.html on that page take a look at the form, the values with *'s disappear but the clone EMAIL input i made doesnt cause i took the * off the value.

Ive been going crazy trying to figure out where this is being configured on the page, If any inspect elementors can take a look and let me know i would greatly appreciate it!

this is the code snip

<form id="ajax-contact-form" action="">
<input type="text" name="name" value="Name *" title="Name *" />
  <input type="text" name="email" value="Email *" title="Email *" />
  <input type="text" name="email" value="Email " title="Email *" />
  <textarea name="message" id="message" title="Message *">Message *</textarea>
  <div class="clear"></div>
  <input type="reset" class="btn btn_clear" value="Clear form" />
  <input type="submit" class="btn btn_blue btn_send" value="Send message!" />
  <div class="clear"></div>
 </form>
War es hilfreich?

Lösung

Search your code to find what makes the input's value disappear. E.g., look for behavior that clears the value of form fields (either element.value = '' if using plain javascript, or element.val('') if using jquery).

Then you can see what is the condition to clearing it. In your case, seems that the condition is that the input's value is equal to it's "title" attribute (you can edit both using "Inspect Element" in Chrome).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top