Skip to content Skip to sidebar Skip to footer

(PHP&JavaScript) A Href Add Button Won't Work On Mozilla But Works On IE And Google

I am not really certain if the add button is responsible for the problem since it is working on other browsers perfectly. I hope you could help me in someways. Thank you. By the wa

Solution 1:

Something is wrong with this code:

<a href="#" onclick="javascript: validateForm(action);return false;">

It should be written as:

<a href="#" onclick="validateForm(document.forms['userLocation'].action);return false;">

to point your validator to the form's action.


Solution 2:

You may not put javascript: into onclick attribute. Attributes with on prefix are callbacks (valid JS functions). javascript: is something like protocol specification. So you may use javascript: only in href attribute. Something like:

<a href="javascript: alert(123)">test</a>

To fix your problem just remove javascript: from onlick.

<div id="addBtn">   
        <a href="#" onclick="validateForm(action);return false;"><img src="images/add.png" height="27" width="60"></a>
</div>   

Post a Comment for "(PHP&JavaScript) A Href Add Button Won't Work On Mozilla But Works On IE And Google"