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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:10:54+00:00 2026-06-17T15:10:54+00:00

I have been searching for a few days on how to do this and

  • 0

I have been searching for a few days on how to do this and I have yet to find an example of what I am looking for. Am I looking for the wrong thing?

Here is what I am trying to accomplish using the following code, I am reading in my error code and creating a link out of the error code.

<p><h4>Errors Returned (if any): </h4> 
    <a href="https://www.mysite.com/test/search_form.php?query=<?php echo $ERRORCODE; ?>">
        <?php echo $ERRORCODE; ?>
    </a>
</p>

I am then posting this information to my search form (below):

<?php
if (isset($_GET['query']))
{
    echo "javascript... and such.";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>Search - Test Site 2013</title>
  </head>
    <table border="0" cellpadding="10">
      <tr>
        <td>
          <img src="images/test.png">
        </td>
        <td>
          <h1>Search - Test Site 2013</h1>
        </td>
      </tr>
    </table>
<body>
    <form action="search.php" method="GET" name="errorsearch">
        Search by Error Code
        <input type="text" name="query" />
        <input type="submit" value="Search" name="search"/>
    </form>
</body>
</html>

I am using (isset($_GET[‘query’])) to check if the error code has been passed over in the URL. I am able to successfully display a message or something silly, but I would like to submit the form and check for the error code text BUT ONLY IF query has been set.

It is my understanding that Javascript can do this but I am unsure exactly what is needed. I was researching Javascript submit buttons and on-click events but I think this is the opposite of what I want. I just need JS to initiate the button click.

Can someone point me in the right direction?

  • 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-17T15:10:55+00:00Added an answer on June 17, 2026 at 3:10 pm

    There are a number of different ways you could do this, but this question has already been answered elsewhere on this site. The answers here should help you:
    JavaScript code to stop form submission

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

Sidebar

Related Questions

I have been searching through here and google for a few days now, trying
I have been searching a solution for this since 2 days but couldn't find
I have been searching about this for the past few days but I don't
I have been searching about this subject now for quite a few days. And
I have been searching for a few days now, but I cannot find a
I have been searching for this for the past few days and every tutorial
I have been searching for a solution to this issue for a few days
I have been searching for a few hours and cant seem to find answer
I have been searching several days for an example of how to make a
I have been searching for an answer to this question for days and it

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.