Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3406164
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:35:40+00:00 2026-05-18T05:35:40+00:00

I have a main page (Home.aspx) and on selecting a link from the menu

  • 0

I have a main page (Home.aspx) and on selecting a link from the menu i send an asynchronous request to the server and load the response (another aspx page) inside jquery tabs.

Now i have different hyperlinks inside the pages and on click i call a method in an external js file. How do i get the form id of the clicked hyperlink.

To be simple on click of a hyperlink calls a method, will i get the id of the form to which the hyperlink belongs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:35:40+00:00Added an answer on May 18, 2026 at 5:35 am

    If you don’t use a javascript toolkit/framework and don’t care to learn good practises and simply want to get the job done.

    <!-- inside a form somewhere -->
    <a href="url" onclick="javascript:doStuff(this);">link text</a>
    
    <!-- somewhere else in your page, where you put javascript -->
    <script>
        function doStuff(node) {
            var ancestor = node.parentNode;
            var formID;
            while( ancestor && ancestor !== document ) {
                if ( /^form$/i.test( ancestor.nodeName ) ) {
                    formID = ancestor.id;
                    break;
                }
                ancestor = node.parentNode;
            }
            if ( formID ) {
                // do stuff with formID
            }
        }
    </script>
    

    If you use jQuery:

    $("form a").click(function(e){
        var formID = $(this).closest("form").attr("id");
        if( formID ) {
            // do stuff with formID
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main page that I want to be a sort of dispatch
I have a main window (#1) on my webpage from which I open a
I have a main table that I must get data from. I have a
I have a doubt about orkut's new URL Writing method. Earlier the home page
My question is quite simple. I have my main page (www.domain.com/index.php) Is there a
i have a table called category in which i have main category ids and
I have a main asp.net app, which is written in asp.net 1.1. Runnning underneath
I have a main canvas 'blackboard' in a panel, this canvas has itself several
I have my main GUI thread, and a second thread running inside it's own
I have a main form and as sub form. I need the main Form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.