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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:04:24+00:00 2026-05-28T05:04:24+00:00

I have this code: <form method=get action= id=search> <input id=search_box name=search type=text class=’search_box’ onkeypress=if(event.keyCode==13)

  • 0

I have this code:

<form method="get" action="" id="search">
<input id="search_box" name="search" type="text" class='search_box'  onkeypress="if(event.keyCode==13) sentAjax('searchdata.php');var filelink='searchdata.php';"  value="" onclick="this.value=''" />
        <input type="hidden" name="course_val" id="course_val" />
</form>

I want to block the form from submitting to a different page.Now if you hit enter it submits to a different page

  • 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-28T05:04:25+00:00Added an answer on May 28, 2026 at 5:04 am

    in pure javascript

    <form method="get" action="" id="search" onsubmit="return false;">
    ...
    </form>
    

    Please note that will not let you submit the form so ideally you would invoke your submit handler function in which you would control when you want to submit

    <form method="get" action="" id="search" onsubmit="return mySubmitHandler()">
    ...
    </form>
    

    and in your submit handler

            function mySubmitHandler(){
            if (submit_criteria_met) {
            return true;
            } else {
            return false;
            }
    return false;
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<form id=youtube-form method=post action=> <label for=searchField id=label-youtube-id>YouTube ID:</label> <input type=text id=searchField name=videoid class=search-field />
I have the following code: <form action=search.php method=get name=searchprod id=prodsearch> <table border=0 cellpadding=0 cellspacing=0>
I have a form like this: <form id=form_main name=form_main action=/search/ target=iframe001 method=get onSubmit=reset_and_subm();> Enter
I have created a form in my application as follows: <form action=/search/ method=get> <input
I am trying to construct equivalent of this code in JSF2 <form action=/search.xhtml method=get>
My form.html <form id=search-form method=post action=. name=f> <p><label for=id_customer_type>Customer type</label> <select name=customer_type id=id_customer_type> <option
I have a issue, I have a form called quicksearch CODE <form method=GET name=quicksearch
I have this code below: <?php function wp_copickpage() { color_option_update(); ?> <form method=POST action=>
I have this code in my cfm, which works <cfif not StructIsEmpty(form)> <cfset larray
I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',

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.