如何将表单字段显示为超链接?

时间:2014-02-10 06:25:56

标签: forms hyperlink

我正在使用表单来显示数据库中的值,编辑它并再次提交到数据库。

表单内的表格及其tr

<tr>
 <td><label for="userwebsite">Website</label></td>
 <td>
  <div class="input-field-pair-edit-user">
   <form:input path="userWebsite" id="userWebsite" />
  </div>
 </td>
</tr>

我需要的是在显示时我想将网站(我在“userWebsite”中获得的值)显示为超链接。

3 个答案:

答案 0 :(得分:0)

for make hyper link to your website ...

<tr>
 <td><label for="userwebsite"><a href="http://www.mywebsite.com" target="">Website</a></label></td>
 <td>
  <div class="input-field-pair-edit-user">
   <form:input path="userWebsite" id="userWebsite" />
  </div>
 </td>
</tr>

Ref Link

答案 1 :(得分:0)

inside your <td> tag, 
<a href="http://www.yourwebsite.com">This is My Site</a>

答案 2 :(得分:0)

在你的网站中使用像我的网站这样的锚标签,然后它可以正常工作。

以下是从您的表格中打开Goog​​le的示例代码

<tr>
 <td><label for="userwebsite">Website</label></td>
 <td>
   <a href="http://www.google.com">Google</a>
  <div class="input-field-pair-edit-user">
   <form:input path="userWebsite" id="userWebsite" />
  </div>
 </td>