Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ACTION attribute

ACTION attribute

Scheduled Pinned Locked Moved ASP.NET
question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    horvat
    wrote on last edited by
    #1

    How can I programmaticaly change content of ACTION attribute? When I click on submit button, it doesn't redirect to URL specified in ACTION attribute. Why?:confused:

    C 1 Reply Last reply
    0
    • H horvat

      How can I programmaticaly change content of ACTION attribute? When I click on submit button, it doesn't redirect to URL specified in ACTION attribute. Why?:confused:

      C Offline
      C Offline
      ChrisWFL
      wrote on last edited by
      #2

      We had this problem too. If you view the source of the page, you'll see that .Net has overwritten your action to postback. You might want to put this form on your .aspx page and take out the runat="server" attributes. Don't mess with the form that .Net puts there, just leave it.

      H 1 Reply Last reply
      0
      • C ChrisWFL

        We had this problem too. If you view the source of the page, you'll see that .Net has overwritten your action to postback. You might want to put this form on your .aspx page and take out the runat="server" attributes. Don't mess with the form that .Net puts there, just leave it.

        H Offline
        H Offline
        horvat
        wrote on last edited by
        #3

        I think I found a solution:cool:: <!-- function ChangeAction() { var theform = document.NameOfTheForm; theform.action = "http://somelink"; } // --> I call this Javascript function on Submit Button clicked and it works!:-D

        P A 2 Replies Last reply
        0
        • H horvat

          I think I found a solution:cool:: <!-- function ChangeAction() { var theform = document.NameOfTheForm; theform.action = "http://somelink"; } // --> I call this Javascript function on Submit Button clicked and it works!:-D

          P Offline
          P Offline
          Paul Watson
          wrote on last edited by
          #4

          horvat wrote: I call this Javascript function on Submit Button clicked and it works I came to the same conclusion :-D But I put that javascript in the ONLOAD event of the BODY element. The form is not always submitted by the INPUT button. On second thought though maybe in the ONSUBMIT of the form will be better.

          Paul Watson
          Bluegrass
          Cape Town, South Africa

          Macbeth muttered: I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er DavidW wrote: You are totally mad. Nice.

          1 Reply Last reply
          0
          • H horvat

            I think I found a solution:cool:: <!-- function ChangeAction() { var theform = document.NameOfTheForm; theform.action = "http://somelink"; } // --> I call this Javascript function on Submit Button clicked and it works!:-D

            A Offline
            A Offline
            Andy Smith
            wrote on last edited by
            #5

            If you absolutely must change the action property of the form, a better solution would be to go grab my free CustomForm[^] control. This won't required script support on the client. Just set the Action property on the form as usual.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups