1

说到 HTML,我是个菜鸟。我有一个 HTML 模板。在这个模板中,我试图用标签替换两个form标签a。两者form有不同的action定义。我需要一个a标签,相当于执行两个forms 执行的相同操作。

这是我的 HTML 代码:

 <form target="_top" action="###URL###/spg/proxy" method="POST"></form>
 <form method="POST" action="###S_URL###" target="_top">
  <td class="buttonbg" colspan="2">
    <input name=rurl type=HIDDEN value="###URL###">
    <input name=udata type=HIDDEN value="###URLDATA###">
    <input type="submit" class="buttoned unhighlight"  value="###PROXY_VIEW_UNPROXIED###" style="*padding:0 4px;" name="###PROXY_VIEW_UNPROXIED###" />
   </td>
  </form>

最后我渴望这样:

<td class="buttonbg" colspan="2">
  <a href="**CODE**" onClick="**CODE**" >
  <input name=rurl type=HIDDEN value="###URL###">
  <input name=udata type=HIDDEN value="###URLDATA###">
   <input type="submit" class="buttoned unhighlight"  value="###PROXY_VIEW_UNPROXIED###" style="*padding:0 4px;" name="###PROXY_VIEW_UNPROXIED###" /></a>
</td>

我用谷歌搜索并找到解决方案说“添加两个 Javascript 函数func1func2。现在调用。func2在标签中func1设置func1onClick事件。”a

但我认为这是最后的选择,有没有更好的方法呢?

编辑: 如果您想在这里查看我的整个 HTML 代码:

<div  id='results_header'>
<form action="###CGIBASE###/search" autocomplete="off" method="POST" name="blah1" id="search_form" onSubmit="return verifyChecked(this);" target="_parent">
      <table cellspacing="0" cellpadding="0" border="0" >
        <tr>
          <td id='input_p'>

            <input type=hidden name=cmd value="process_search">
            <input type=hidden name=language value="###LANGUAGE###">
            <input type=hidden name=enginecount value="1">
            <input type=hidden name=pl value="">
            <input type="hidden" name="abp" class='abp' value="-1" />
            <input type=hidden name=ff value="">
            <input type=hidden name=theme value="">
            <input type=hidden id=flag_ac1 name=flag_ac value="0">
            <input name="cat" type=hidden value="###CAT###">
            <input type='text' autocomplete='off' name='query' id='query_top' value="###ESCAPEQUOTEDQUERY###" style="width:256px\9;" >


           </td>
          <td><input type='image' src='graphics/stp_search.gif' id='submit1' style="margin-left:0\9;"/></td>
          <td class="mesg"><p style="visibility:hidden"></p></td>
          <td>
              <table  border="0" cellspacing="0" cellpadding="0" class="buttonwrap">
              <tr>
                <td class="buttonbg"><a href="###HIGHLIGHTERBACKBUTTONREFERRER###" target="_top" onClick="return goback('###HIGHLIGHTERBACKBUTTONREFERRER###');" style="text-decoration: none;">
                 <input type="button" class="buttoned"  value="###HIGHLIGHTERBACKBUTTON###" style="*padding:0 21px;"/ name="BACKBUTTON"></a>
                </td>
              </tr>
            </table>
            <span class="return_result_page">###HIGHLIGHTERBACKBUTTONDESC###</span></td>
                      <td width="25"><img src="graphics/spacer.gif" width="25" height="1"/></td>
          <td>
           <form style="margin:0; padding:0" target="_top" action="###SCRIPTURL###" method="POST">
           <table  border="0" cellspacing="0" cellpadding="0" class="buttonwrap">
              <tr>
                <form target="_top" action="###CGIBASE###/spg/proxy" method="POST"></form>
                <form method=POST action="###SCRIPTURL###" target="_top">
                <td class="buttonbg">
                 <input name=rurl type=HIDDEN value="###URL###">
                 <input name=udata type=HIDDEN value="###URLDATA###">
                 <input type="submit" class="buttoned unhighlight"  value="###LINKUNHIGHLIGHTED###" style="*padding:0 4px;" name="submit" />
                </td>
              </tr>
            </table></form>
          <span class="return_result_page" style="*margin-top:-20px;">###VIEWUNHIGHLIGHTED###</span>
         </td>
        </tr>
      </table>
    </div>
4

0 回答 0