Form Action using Ajax+Not working in IE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vetrib2w
    New Member
    • Aug 2008
    • 14

    #16
    It is not the html file and it is template file.I am using smarty template .It is very big fine so i cant able to post the file.
    Originally posted by acoder
    In that case, post the corresponding HTML code that would allow us to reproduce the error.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #17
      View the source in the browser. You don't need to post everything, just the relevant parts of the form.

      Comment

      • iam_clint
        Recognized Expert Top Contributor
        • Jul 2006
        • 1207

        #18
        Originally posted by acoder
        View the source in the browser. You don't need to post everything, just the relevant parts of the form.
        why not use setAttribute

        Code:
        document.forms.whatever.setAttribute("action", [URL]http://www.wherever.com);[/URL]

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #19
          setAttribute will just avoid an error, but it still won't solve the problem, e.g.
          Code:
          <html>
          <body>
          <script type="text/javascript">
          function setFormAction() {
             document.forms.formname.setAttribute("action","http://www.google.com");
          }
          </script>
          <form name="formname">
          <input type="button" value="Set Form Action" onclick="setFormAction()">
          <input type="hidden" name="action">
          <input type="submit">
          </form>
          </body>
          </html>
          now if you comment out the hidden field, it'll work both ways:
          Code:
          <html>
          <body>
          <script type="text/javascript">
          function setFormAction() {
              document.forms.formname.action="http://www.google.com";
          }
          </script>
          <form name="formname">
          <input type="button" value="Set Form Action" onclick="setFormAction()">
          <!--<input type="hidden" name="action">-->
          <input type="submit">
          </form>
          </body>
          </html>

          Comment

          Working...