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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:03:09+00:00 2026-05-26T14:03:09+00:00

The page source: <html> <head> <title>Admin Search Results</title> <script type="text/javascript"> function delete() { alert("abc");

  • 0

The page source:

<html>
<head>
<title>Admin Search Results</title>

<script type="text/javascript">
function delete()
{     
    alert("abc");
}
</script>
</head>
<body>
<h1>Admin Search Results</h1>
<form id="modDel" action="modDel.pl" method="post" onsubmit="return delete()">
<table border="1">
<tr>
<th>User Name</th>
<th>Email</th>
<th>First Name</th>
<th>Last Name</th>
<th>Password</th>
<th>Blocked</th>
<th>Modify</th>
<th>Delete</th>
</tr>
<tr>
<input type="hidden" id="un_0" name="un_0" value="aa">
<td>aa</td>
<td>aa</td>
<td>aa</td>
<td>aa</td>
<td>aa</td>
<td>0</td>
<td><input type="submit" name="modify_0" value="Modify"></td>
<td><input type="checkbox" id="delete_0" name="delete_0" value="Yes"></td>
</tr>
<tr>
<input type="hidden" id="un_1" name="un_1" value="a">
<td>a</td>
<td>a</td>
<td>a</td>
<td>a</td>
<td>a</td>
<td>0</td>
<td><input type="submit" name="modify_1" value="Modify"></td>
<td><input type="checkbox" id="delete_1" name="delete_1" value="Yes"></td>
</tr>

</table>
<input type="hidden" id="count" name="count" value="1">
<input type="submit" id="delete" name="delete" value="Delete Selected Accounts" onclick="delete()">
<button type="button" onclick="delete()">Display Date</button>
</form>
</body>
</html>

It’s generated by a Perl script from two templates (one for the table).

All I want is to get something to happen on some event. I’ve added onsubmit and onclick but neither work.

I’m sure I’m just missing something small but I can’t see it.
I’m using Chrome, BTW.

Edit: I can get it to work by adding the js code directly into the onclick/onsubmit quotes.

  • 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-26T14:03:10+00:00Added an answer on May 26, 2026 at 2:03 pm

    The problem here is that delete is a reserved word in JavaScript. Try a different function name. Also there is no need for the return in the onsubmit function, just invoke the function directly.

    <script type="text/javascript">
    function deleteFunc()
    {     
        alert("abc");
    }
    </script>
    </head>
    <body>
    <h1>Admin Search Results</h1>
    <form id="modDel" action="modDel.pl" method="post" onsubmit="deleteFunc()">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to access the page HTML source code using javascript? I
I have a every common page a.html which looks like this: <html> <head> <script
I have this fragment that demonstrates the problem: <html> <head> <title>height query demo</title> <script
jquery.js source code is not being recognised by browser using my page.html served by
The application.html.erb file: <!DOCTYPE html> <html> <head> <title>Site</title> <%= stylesheet_link_tag :all %> <%= javascript_include_tag
I copy the following from source of http://jquerymobile.com/demos/1.0/docs/pages/multipage-template.html <!DOCTYPE html> <html> <head> <meta charset=utf-8>
I have seen a web page source code containing the following css declaration at
I have a FileUpload control in the Source page. On the Upload button handler,
If I have a decent size asp.net page open in Source view, and hold
I am asp.net-MVC using the BeginForm syntax in my source ciew page and 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.