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. How to get form id in javascript function?

How to get form id in javascript function?

Scheduled Pinned Locked Moved ASP.NET
questionjavascripttutorial
2 Posts 2 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.
  • G Offline
    G Offline
    Guru_yogi
    wrote on last edited by
    #1

    Hi.. How can i get form id of form from which request is sent? Actually I have menu file which is created in javascript and I want to redirect to the home page of second application. I m calling the PostPage function on click of that menu. But this menu can be clicked from any form of the 1st application. So please tel me how can i do this task? function PostPage() { document.form1.action = "http://Ip-address/issuetracker/"; document.form1.method = "POST"; document.form1.submit(); return }

    Gurudatta B. Shelke

    S 1 Reply Last reply
    0
    • G Guru_yogi

      Hi.. How can i get form id of form from which request is sent? Actually I have menu file which is created in javascript and I want to redirect to the home page of second application. I m calling the PostPage function on click of that menu. But this menu can be clicked from any form of the 1st application. So please tel me how can i do this task? function PostPage() { document.form1.action = "http://Ip-address/issuetracker/"; document.form1.method = "POST"; document.form1.submit(); return }

      Gurudatta B. Shelke

      S Offline
      S Offline
      Saifi Hasan
      wrote on last edited by
      #2

      rather than form ID use forms[0] like this document.forms[0].action =".."

      Nobody is perfect i'm Nobody

      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