Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat can I do to keep default text from being submitted in a web form if a user does not enter information?
    primarykey
    data
    text
    <p>I have a form that asks for First/Last name, email and phone. I don't want to use "placeholder" since IE lacks that ability. I have tried many things but do not know enough about script coding on how I can strip the default text out of the field when someone submits their information.</p> <p>I need to find a way to have the code below only send me the data for the fields typed in and not the txt from the form like "Phone</p> <pre><code>&lt;form action="{SUBMIT_FORM}" method="post"&gt; &lt;input type="text" class="input-field" onblur="if (this.value == '') {this.value = '*First Name : (Required Field)';}" onfocus="if (this.value == '*First Name : (Required Field)') {this.value = '';}" name="{lead_first_name}" id="{lead_first_name}" value="*First Name : (Required Field)"/&gt; &lt;input type="text" class="input-field" onblur="if (this.value == '') {this.value = 'Last Name :';}" onfocus="if (this.value == 'Last Name :') {this.value = '';}" name="{lead_last_name}" id="{lead_last_name}" value="Last Name :"/&gt; &lt;input type="text" class="input-field" onblur="if (this.value == '') {this.value = '*Email : (Required Field)';}" onfocus="if (this.value == '*Email : (Required Field)') {this.value = '';}" name="{lead_email}" id="{lead_email}" value="*Email : (Required Field)"/&gt; &lt;input type="text" class="input-field" onblur="if (this.value == '') {this.value = 'Phone :';}" onfocus="if (this.value == 'Phone :') {this.value = '';}" name="{lead_home_phone}" id="{lead_home_phone}" value="Phone :"/&gt; &lt;input type="submit" class="sbt-btn" value="Submit" onclick="{SUBMIT_SCRIPT}" /&gt; {VALIDATE_SCRIPT} &lt;/form&gt; &lt;small&gt;*We promise to never share, rent or sale your personal information.&lt;/small&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload