TypeError: f [s] não é uma função para submissão do formulário jquery
Estou tentando obter um formulário para enviá-lo de forma indireta, já que preciso anexar novos dados antes de enviá-lo. Como colocar anexos na função real $ (form) .submit () não os reunirá para postagem, adicionei um botão html para chamar um submitCheck () e depois enviar a função real.
function init() {
$("#submit").click(submitCheck);
//and lots of other stuff
}
function submitCheck() {
//go through fabric canvases, save xml to input.
for (var i=1; i<probNum; i++) {
var csvg = gcanvas[i].toSVG();
$('#output').append("<input type='hidden' name='svg"+probNum+"' value='"+csvg+"'></input>");
}
//make sure a topic was selected. If not cancel submission and don't do anything.
if ($("#topic").val() == '-1')
{
$('#error').html("You must select a valid topic");
} else {
//submit the form
alert('should submit now');
$("form:first").submit();
}
}
Mas ... ele falha, jogando o erro de tipo:
TypeError: f[s] is not a function
Não encontrei documentação sobre esse erro específico. Alguma ideia?