Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" media="screen" href="styles.css" &gt; &lt;script type="text/javascript" src="my.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/jquery-2.0.3.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function validateForm() { var name = document.getElementById('name').value; if (name == "" || name == null) { $('#errortext1').html('please enter name.'); return false; } else if{ var email = document.getElementById('email').value; if (email == "" || email == null) { $('#errortext2').html('please enter email.'); return false; } else if{ var message = document.getElementById('message').value; if (message == "" || message == null) { $('#errortext3').html('please enter message.'); return false; } else { return true; } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="mycontactform" class="contact_form" action="" method="post" name="contact_form"&gt; &lt;ul&gt; &lt;li&gt; &lt;h2&gt;Contact Us&lt;/h2&gt; &lt;span class="required_notification"&gt;* Denotes Required Field&lt;/span&gt; &lt;/li&gt; &lt;li id="name"&gt; &lt;label for="name"&gt;Name:&lt;/label&gt; &lt;input type="text" id="name" name="name" placeholder="John Doe"/&gt; &lt;br&gt;&lt;small class="errorText"&gt;&lt;/small&gt;&lt;/br&gt; &lt;div id="errorText1" style="color:red;"&gt;&lt;/div&gt; &lt;/li&gt; &lt;li id="email"&gt; &lt;label for="email"&gt;Email:&lt;/label&gt; &lt;input type="email" name="email" id="email" placeholder="john_doe@example.com" required /&gt; &lt;span class="form_hint"&gt;Proper format "name@something.com"&lt;/span&gt; &lt;br&gt;&lt;small class="errorText"&gt;&lt;/small&gt;&lt;/br&gt; &lt;div id="errorText2" style="color:red;"&gt;&lt;/div&gt; &lt;/li&gt; &lt;li id="message"&gt; &lt;label for="message"&gt;Message:&lt;/label&gt; &lt;textarea name="message" id="message" cols="40" rows="6" required &gt;&lt;/textarea&gt; &lt;br&gt;&lt;small class="errorText"&gt;&lt;/small&gt;&lt;/br&gt; &lt;div id="errorText3" style="color:red;"&gt;&lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="button" class="submit" id="submit" onclick="return validateForm()"/&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

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