ITeye博客

如果通过超级链接提交表单

Roader123 · 2010-08-08 23:56 · JAVA EE · Web前端 · Markdown

http://akunamotata.iteye.com/blog/357593

 

 

<  script LANGUAGE  =  "  JavaScript  "  >
 function  checkvalue()
 {
    if (document.welcomeform.nickname.value == "" )
    {
    alert( " 昵称不能为空! " );
     return ( false );
    }
    if (document.welcomeform.password.value == "" )
    {
    alert( " 密码不能为空! " );
     return ( false );    
    }
   document.welcomeform.submit(); 
    return ( true );   
 }

 < body >
 < form name = " welcomeform "  method = " post "  action = " welcome.asp " >
    < a href = " # "  onclick = " javascript:checkvalue();return false: " > 登录 </ a >
</ form >  
 </ body > 

 

第二种方式:

 

 

<form name="welcomeform" method="post" action="welcome.asp"> 
<input type=text> 
</form> 
<a href="javascript:document.welcomeform.submit();">提交</a>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。