To submit my form, the user need choice the price of your ticket by html droplist.
Here is JS the code:
var ticket = document.getElementById('ticket-box');
var member = document.getElementById('member');
var form = document.getElementById('form');
form.style.display = 'none';
ticket.style.display = 'none';
member.addEventListener('change', function() {
var chosen = member.options[member.selectedIndex].index;
if(chosen == 1) {
form.style.display = 'inline-block';
ticket.style.display = 'inline-block';
form.selectedIndex = 2;
form.options[0].style.display = 'none';
form.options[1].style.display = 'none';
form.options[2].style.display = 'inline-block';
form.options[3].style.display = 'inline-block';
form.options[4].style.display = 'none';
form.options[5].style.display = 'none';
$(function() {
$('#btnget').click(function(e) {
let formValido = document
.getElementById("formulario")
.checkValidity();
if(formValido){
$("#formulario")
.attr("action", $('#form').val())
.submit();
}
})
});
}
});
This only works in chrome (email is comming only in chrome).
Why is this happening?
form link: http://www.congressoprotecaodados.com.br/inscricao/form22.html
也许你正在使用一些只支持chrome的javascript函数或关键字。请参考mozilla developpe netword来检查浏览器对任何内置函数的支持。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.