Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScript Form validation in IE
    primarykey
    data
    text
    <p>Hi all I am working on a contact or phone book application. So currently I am working on searching for records. Now I have this form with certain elements/fields being required or mandatory while others are optional. </p> <p>So I wrote a very simple javascript function to check if those required fields are missing or not. It works greate on firefox and chrome however not in IE. </p> <p>It seems that the if clause is failing in my js in IE because wheather i enter the required fields or don't enter the required fields i get the alert message telling me to enter the rquired fields. Mind you this doesn't happen in firefox only IE. So I'll put some relevant code bits here for you to have a look hoping you can help me out here:</p> <p>head</p> <p>some css code </p> <p>...</p> <pre><code>&lt;script type="text/javascript"&gt; function disp_confirm() { if (document.contractor_phonebook_form.Service.value == "" || document.....etc.) { javascript:alert('Please enter all necessary fields!'); return false; } else { return true; } } &lt;/script&gt; end of head beginning of body &lt;form action='&lt;?php $PHP_SELF; ?&gt;' method='post' name="contractor_phonebook_form" target="_self" onSbumit="return disp_confirm()"&gt; </code></pre> <p>some of the form elements are autofilled from a database query using mysql and php to fill the form elements. while others are simple drop down menus. </p> <pre><code> &lt;select name="Service"&gt; ... etc.. </code></pre> <p>hopefully you have an idea of what i have here and why does IE always give me the alert message please fill in the required fields wheahter I ENTER OR DON'T ENTER any form fields..</p> <p>thank you in advance again..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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