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. form submit using javascript

form submit using javascript

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-net
3 Posts 3 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.
  • D Offline
    D Offline
    deepaks3
    wrote on last edited by
    #1

    hi I am using a button in asp.net 2.0 ,, i have to submit the form in javascript , called by the onclick event of the button

    J G 2 Replies Last reply
    0
    • D deepaks3

      hi I am using a button in asp.net 2.0 ,, i have to submit the form in javascript , called by the onclick event of the button

      J Offline
      J Offline
      John Petersen
      wrote on last edited by
      #2

      You could do something like this.

      Response.Write("function doSubmit(){var form = getElementById('" + AspButton.ClientID + "'); form.submit(); }");

      This will first get the form object and then call the submit() function on it. Assign a call to this funtion on the buttons onClick event and you are home free.

      Kind Regards, John Petersen

      1 Reply Last reply
      0
      • D deepaks3

        hi I am using a button in asp.net 2.0 ,, i have to submit the form in javascript , called by the onclick event of the button

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        If the button is inside the form that you want to post, you can just use: this.form.submit();

        --- b { font-weight: normal; }

        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