Javascript Uncaught TypeError:无法调用undefined方法'submit'

时间:2013-12-28 19:21:35

标签: javascript jquery html forms

我有这个基本代码:

HTML:

<form name='susprip' action='susprip.php'>
    <strong>Annually:</strong> <input type='text' name='user' value=''>
    <input type='text' name='pass' value=''>
    <input type='text' name='mail' value=''>
    <input type='radio' name='wtd' value='Suspend'>Suspend<input type='radio' name='wtd' value='Unsuspend'>Unsuspend<input type='radio' name='wtd' value='Create'>Create
    <a href='javascript: submitform()'>Submit</a>
</form>

使用Javascript:

function submitform()
{
    document.forms["susprip"].submit();
}

一切正常,现在当我尝试点击提交链接时,没有任何反应。我在控制台中得到了这个:

Uncaught TypeError: Cannot call method 'submit' of undefined susprip.js:3
submitform susprip.js:3
(anonymous function)

任何帮助将不胜感激,谢谢你提前:))

0 个答案:

没有答案