I have a submit on my page:
<input type="submit" name="nextstep" value="Next" id="nextstep" class="newaddressnextstepbutton">
and when I click on this submit I need to make another submit on first button with specific name like this:
<input type="button" name="selectBillingAddress" value="First one" class="selectbillingaddressbutton" onclick="setLocation('/checkout/selectbillingaddress?addressId=537')">
<input type="button" name="selectBillingAddress" value="Second one" class="selectbillingaddressbutton" onclick="setLocation('/checkout/selectbillingaddress?addressId=647')">
I did it like this:
$("input[name='nextstep']").click(function() {
$("input[name='selectBillingAddress']")[0].submit();
});
But this not working. I get this error: Uncaught TypeError: $(...)[0].submit is not a function
I found this answer for this error "Submit is not a function" error in JavaScript but I dont have input[name='submit']
on this page..
Can anybody help me?