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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:07:22+00:00 2026-06-18T15:07:22+00:00

I have a html button that should be firing javascript on button click. It

  • 0

I have a html button that should be firing javascript on button click. It recognizes the button click and display the confirm alert but does not continue on and post the console.logs or go to into the ajax method.
Here is the javascipt function:

      $('.Delete')
         .click(function() {
    return confirm("Are you sure you'd like to delete this entry?"
        if(return = true)
    {
                 var parent = $(this).parent().prev();
                 var tr = $(this).closest('tr');


                 var ValNode = tr.find(".typeText").first();
                 var AddrNode = parent.children(".AddrText").first();

                 var Val = ValNode.val();
                 var addr = addrNode.val();

                 console.log(Val);
                 console.log(addr);

                 var item = { Value: Val, Address: addr }
                 deleteItem(userID, item);
    }

         });

This is the html elements I think it may have to do with the relationship of the button to the elements its calling. I have them as cousins.

<asp:ListView runat="server" id="ListView1" >
        <LayoutTemplate>
                <thead>
                    <tr>
                        <th>
                            <a href="#">Type</a>
                        </th>
                        <th>
                            <a href="#">Address</a>
                        </th>                                                                                    
                    </tr>
                </thead>
                <tbody>
                    <tr id="itemPlaceholder" runat="server" />
                </tbody>
                <tfoot>
                </tfoot>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td>
                   <input type="text" id="Type" class="TypeText "  value="<%# Eval("Type")%>" />                     
                   <input type="text" id="Addr" class="AddrText "  value="<%# Eval("Address")%>" />                
                </td>
                <td>
                   <input type="button" id="btn_update" class="Update" value="Update" />
                   <input type="button" id="btn_delete" class="Delete" value="Delete" />
                </td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
  • 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-18T15:07:24+00:00Added an answer on June 18, 2026 at 3:07 pm

    1.return is a reserved word in JavaScript. It is used to specify what a function returns to the caller. Do not use it for variable names.

    Change

    return confirm("Are you sure you'd like to delete this entry?"

    to

    var result = confirm("Are you sure you'd like to delete this entry?");

    2.Your if condition check is incorrect

    Change

    if(return = true)

    to

    if(result == true)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a radio button that triggers in Firefox 2.0 but it does not
I have a very simple HTML that should open a fading modal, but it
I have this link (not a button) that I want to click on ...I
I have a button that, when pressed, will add a new HTML row. Within
I have a html form with no submit button. I want to submit that
This is probably a basic html/css question... I have a simple one-button form that
I have a block of HTML code that contains a button <button class=someButton onclick=openPage('test')></button>
I have a Delphi program that creates HTML files. Later when a button is
I have html markup like this <button id=button1 onclick=alert='yup'></button> and I want to make
I have a simple html button that I wrap into a div . I

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.