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

  • SEARCH
  • Home
  • 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 449061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:43:55+00:00 2026-05-12T21:43:55+00:00

I have a page where i have multiple textboxes followed by a browse link,

  • 0

I have a page where i have multiple textboxes followed by a “browse” link, like this:

[textbox1] Browse
[textbox2] Browse
[textbox3] Browse

Now I want to know which textbox’s browse link I pushed. I want to set a global variable (how to do that in Javascript/JQuery?) and save the textbox, or at least the class/id/name of the textbox so that I know which textbox to manipulate from the browse routing.

I don’t know the id or anything of the textbox since this is generated at run time. All I know is that it’s the previous sibling to the browse link.

EDIT:
Cant get it to work, this is my jquery method, just for testing it:

$(document).ready(function() {
    $('#BrowseLink').click(function() {
        alert($(this).prev('input[type=text]').attr('id'));
        return false;
    });
});

it makes an alert saying “undefined”…

This is my markup on the page:

<input id="Image"  name="Image" width="5px" type="text" value=""></input>&nbsp;<a id="BrowseLink" href="#">Browse</a>

EDIT EDIT
Looking at my markup i solved it, the nbsp; is an entity aswell, hence the need for prev().prev()

  • 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-12T21:43:55+00:00Added an answer on May 12, 2026 at 9:43 pm
    // attach a click handler to all of the browse links
    $('a.someClassThatAllBrowseLinksAreMarkedWith').click(function() {
        var associatedTextBoxValue = $(this).prev('input[type=text]').val();
        // TODO: do something with the value
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple input textboxes in my page. I want to reset particular text
I am creating one admin page where I have multiple textboxes.when I enter the
I have a page with multiple textboxes and each has a button associated with
So I have a page, it had multiple textboxes, linkbuttons, and buttons. Currently, a
Ok, so I have a multiple ASP textboxes and ASP buttons on a page
I have a page with multiple forms that I submit via Ajax POSTs serially.
I have a page with multiple YouTube embedded players that I need to listen
I have an aspx page with multiple FileUpload controls and one Upload button. In
I have a form on an HTML page with multiple submit buttons that perform
I have an ASP.NET MVC page with multiple file uploads. After a failed post,

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.