---
title: "如果通过超级链接提交表单"
author: "Roader123"
date: "2010-08-08T23:56:48Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2010-08-08T23:56:48Z"
id: 732329
url: "https://roader123.iteye.com/blog/732329"
---

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>
```