Firefox 31 javascript submit not working

problem with firefox 31 as javascript submit is not working. The problem occurs on the product page, because after selecting the product it does not move to the cart page or the wish list page. I tested it on other browsers, as well as on firefox 30, and it works fine on them. I also tried to disable other plugins, but it did not work. I am debugging the code snippet below, and its variable gets the desired values ​​according to the logic, for example, it enters another only when the user has checked the field. I will be grateful for any quick solutions.

    echo "<input class=\"button wish_btn_style\" type=\"submit\" value=\"Add to   
    wishlist\" onclick=\"return changelocation('wishlist.php')\"><!--img   
    src=\"img/wishlist_small.png\" width=\"16\" height=\"15\"-->";
    echo "<input class=\"button cart_btn_style\" type=\"submit\" value=\"Add to cart\" 
    onclick=\"return changelocation('cart.php')\"><!--img src=\"img/cart_gray.png\" 
    width=\"32\" height=\"24\"-->";

function changelocation(action)
{var canigo=0;
   var x=document.getElementById('txt_quent').value;
   var status;
 if((x=="") || isNaN(x))
 {
  alert("Please enter quantity only in number");
  var canigo=1;
  return false;
    }

    if(canigo==0)
        {status=$('input:radio[name="subid"]:checked').val();
    if(isNaN(status))
    {

     alert('Please select the desired product specification');
        return false;   
    }
    else
    {

         document.getElementById('product').action=action;
        document.getElementById('product').target='_self';
        document.getElementById('product').submit();


        return true;  

    }
    }

    }
+4
source share
2 answers

"action"?

Firefox 31. Firefox.action 'action' , 31 , ' " .

jQuery:

$("#defForm").attr("action", sURL);

, .

Firefox.

0

: .

, , .

script Firefox 31.

if(ie){
    for(i=document.getElementById('miForm').attributes.length-1;i>0;i--){
        if(document.getElementById('miForm').attributes[i].name=='action'){
            document.getElementById('miForm').attributes[i].value='../views/newJSP.jsp';
            break;
        }
    }
}else document.getElementById('miForm').action='../views/newJSP.jsp';
document.getElementById('action').value='abrir';
document.getElementById('miForm').submit();

Firefox if (..) - , .

.

: ?

https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement.action

:

script . 116, 114, firefox 5, - 0.

form.action.

for(i=document.getElementById('miForm').attributes.length-1;i>=0;i--){
    if(document.getElementById('miForm').attributes[i].name=='action'){
        document.getElementById('miForm').attributes[i].value='../views/newJSP.jsp';
        break;
    }
}
-1

All Articles