2014-02-10 24 views
0

我正在使用窗體來顯示數據庫中的值,進行編輯並再次提交到數據庫。如何將表單字段顯示爲超鏈接?

一隻表的形式內,在它的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」得到的值)URL作爲超鏈接。

+0

試試這個.... Website Zeeshan

回答

0

make的超鏈接到你的網站...

<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

+0

什麼,我需要顯示爲超鏈接是我在「userWebsite」 – puppuli

+0

你可以寫獲得價值你的代碼,是的,我認爲userwebsite鏈接寫在錨標籤。 – Zeeshan

+0

只需將您的userwebsite變量放置在錨標籤hre屬性中。例如:$userwebsite Zeeshan

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

使用錨標記像我裏面的,然後它工作精美網站。

下面是示例代碼,從表中打開一個谷歌

<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> 
相關問題