开发者

Submit button doesn't work in IE

I declared an iFrame in my html, and the source is my XQuery file. In my XQuery, I defined a <div>, within which I also declared a button named "convert".

My XQuery file basically looks like this (this is the source for the iFrame)

return
<div id="content">
 <table>
  ....
  <tbody>
  {
  ...
   <td>
    <a id="{$t/@id}"
       rel="nofollow"
       target="_new"
       name="{util:document-name($t)}:{util:node-id($t)}"
       href=
        "http://localhost:8080/exist/rest/db/motorola/xquery/toDita.xql?xml={
            util:document-name($t)
         }&amp;xsl=mot2dita.xsl">
        <input type="submit" value="convert"/>
    </a>
   </td>
   ...
  }
  </tbody>
 </table>
</div>

As you can see, in a td, I decl开发者_运维技巧ared a button called "convert", and the "href" gives the link. Right now this button works perfectly in Firefox and Chrome(opening a new window to do the task), but in IE, after clicking it, it just doesn't do anything.

I wonder if this is a browser issue or my XQuery script has problems. Thanks in advance for helping out.


<input> tags are not valid inside <a> tags. The XHTML code is therefore not valid, which will account for the inconsistent behaviour - some browsers are better at compensating for odd cases like this than others.

Recommend you remove the <input> entirely and use CSS to style your <a> tag to look like a button, if it's just the look of a button that you're after.


Unless you're inside a form, it's not going to submit anything...definitely not an A tag.

I prefer to do these with Jquery UI's button feature. It gets the desired behavior you're looking for, is progressively enhanced and tested to handle the full gamut of browsers, and can be done use a href links, button elements, or input type=submit elements. Plus, styling looks great and is instantaneous.

Here's a quick tut: http://www.filamentgroup.com/lab/styling_buttons_and_toolbars_with_the_jquery_ui_css_framework/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜