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 9054079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:35:30+00:00 2026-06-16T13:35:30+00:00

I have the following markup <td> <a id=lbtnDelete onclick=deleteFile(this); return false; runat=server class=silverbutton smallbutton

  • 0

I have the following markup

  <td>
       <a id="lbtnDelete" onclick="deleteFile(this); return false;" runat="server" class="silverbutton smallbutton normal">
            <span class="left">
                  <span class="right">Delete</span>
            </span>
       </a>
       <asp:HiddenField runat="server" ID="hidDownloadId" />
  </td>

function deleteFile(element)
{
    var currEl = element;
    var downloadId = currEl.next().value;
}

When user clicks “lbtnDelete” link I call deleteFile(this) function. In this function I should get the value of the hidden input – hidDownloadId. How can I do it? I’ve already tried

currEl.next().value;

but in Chrome i got an error like “Object doesn’t have method next()”. Enother attempt was to do

currEl.parent().find('[type=hidden]')
[Exception: TypeError: Object has no method 'parent']

Any help would be greatly apprecitated.

  • 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-06-16T13:35:31+00:00Added an answer on June 16, 2026 at 1:35 pm

    You need to create jquery object out of your element before you can use jquery methods on it..

    var currEl = $(element);
    var downloadId = currEl.next().val();
    

    But since you go the jquery way, you should also stop using inline event attributes and use jquery for the binding as well..

    So

      <td>
           <a id="lbtnDelete" runat="server" class="silverbutton smallbutton normal">
                <span class="left">
                      <span class="right">Delete</span>
                </span>
           </a>
           <asp:HiddenField runat="server" ID="hidDownloadId" />
      </td>
    

    and

    $(function(){
        $('#lbtnDelete').click(function(e){
            e.preventDefault();
            var currEl = $(this),
                downloadId = currEl.next().val();
    
            // do whatever you want to do with downloadId here
    
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following markup: <asp:DropDownList ID=dd1 AutoPostBack=true runat=server> <asp:ListItem Value=1>1</asp:ListItem> <asp:ListItem Value=2>2</asp:ListItem> </asp:DropDownList>
I have the following markup: <tr> <td valign=top align=left> <asp:Label ID=Label1 runat=server Text=Available Roles
I have the following markup. <para><span class=bidi/><span class=ind/>1</para> I'm trying to achieve this... <para><span
I have the following markup: <Asp:updatepanel id=up runat=server> <contenttemplate> <asp:Button id=btn runat=server text=test />
I have the following markup (this is an example there are hundreds) <div class=Q3>
I have the following markup: <div id=routes> <ul id=routesList> <li class=routes>Route 1</li> <li class=routes>Route
I have the following markup: <p class=managebox> <button value=Add page> <img src=page_add.png alt=Add more
I have the following markup - <div class=area 1 friendly> <div class=area-count> 8 </div>
I have the following markup. I would like to add class_A to <p class=subitem-text>
I have the following markup: <ul class=item> <li id=user_one>Username <ul> <li class=click>Click Here</li> </ul>

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.