I've met a weird use case. there is a form, and I want to auto submit when
the page loaded completed.
we can do it by FORM.SUBMIT()! but, here I get a headache, there is a input
field whose name is 'submit'...
so when I use form.submit(), there is a error : form.submit() is not a
function (of course form.submit is the input node...)
<form id="form1" action="/">
<input type="text" name="submit" />
</form>
<script type="text/javascript">
var f = document.getElementById('form1');
//console.log(f);
//console.log(f.submit);
f.submit();
</script>
so, I want to know is there another way to make the form auto submit
--
Best Regards!
Wen Dong
form.action += (form.action.indexOf('?') == -1 ? '?' : '&') + 'submit=' +
form.submit.value;
form.submit.name = '__'; // rename
form.submit();
this works now, but the submit value is sent by GET method, if the backend
changes (such as php will receive the request value by $_POST, $_GET,
$_REQUEST), it may not get the submit's value.
> _______________________________________________
> dev-ajax mailing list
> dev-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-ajax