2014-01-17 50 views
0

考慮下面的index.html:如何在HTML中使用鏈接而不是按鈕?

<!-- Product Inventory , 2014 --> 

<!-- 

Inventory management tools are used in many different industries to keep track of products and their quantities. 
In this project, we’ll create a simplified version of these tools. 
The basic requirements are as follows: 
-Store product name, quantity, price, numeric ID and category. 
-Search for products by price, ID or name. 
-Quick overview of current inventory, including quantities of different products sorted by category. 
-Updating the database dynamically as a product is ‘checked out’ or removed from the system. 

--> 

<%@ page language="java" 
    contentType="text/html; charset=windows-1256" 
    pageEncoding="windows-1256" 
%> 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd"> 

<html> 
<head> 
    <title>Product Inventory Shop 2014</title> 
    <link rel="stylesheet" 
      href="./css/styles.css" 
      type="text/css"/> 

    <link rel="stylesheet" 
      href="./css/bar.css" 
      type="text/css"/> 
</head> 


<div id ="right" class="bar"> 
<a href="exitTheProgram">GET OUT!</a> 
</div> 

<body> 
<table class="title"> 
    <tr><th>Shop Inventory Program</th></tr> 
</table> 

<br/> 
<fieldset> 
    <legend> 
    Welcome ! Please enter your Username and Password 

    </legend > 
    <form action="loginPage"> 
    <strong>USERNAME</strong>: <input type="text" name="username"><br> 
    <strong>PASSWORD</strong> : <input type="password" name="password"><br> 
    <input type="submit" value="Login"> 
    </form> 

    <form action="RegisterPage"> 
    <strong> Or click here to <input type="button" value="Register"> </strong> 
    </form> 
</fieldset> 

<br/> 
<br/> 
<br/> 
<br/> 
<br/><br/><br/><br/><br/><br/> 
</body></html> 

預覽:

enter image description here

如何使用一個鏈接,而不是註冊框?

含義,我想要鏈接(當鼠標在「註冊」字上時出現的那隻手)並將其轉發給某個Servlet。 (和是的,我知道這是很醜陋,我的工作就可以了... :))

+0

如果你只是想要一個手就可以設置在CSS的'cursor' – Danny

回答

2

使用以下:

<a href="putregisterlinkhere">Register</a> 

a指錨。 href是鏈接的URL;目的地。將putregisterlinkhere替換爲註冊頁面的URL

1

請勿使用表單。

使用一個簡單的鏈接...

Or click here to <a href="register_page.php">Register</a> 
3

而不是

<form action="RegisterPage"> 
    <strong> Or click here to <input type="button" value="Register"> </strong> 
    </form> 

使用

<strong> Or click here to <a href="#link">register</a> </strong> 
相關問題