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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:24:18+00:00 2026-06-12T10:24:18+00:00

I want to submit search term ( e.g what does foo means) into form

  • 0

I want to submit search term ( e.g what does foo means) into form if there is not result

Details:

I have a search function with if else condition where if there is search result than display else message with “No search result found”

Where I wan to change “No search result found” with one form submission where value will be whatever search term user try to find. so…

if search result found {
 //display result
} else {
  // auto submit below form if above condition is not true ( means if no search result found )

    <form action="to url" method="post">
    <input name="title" type="text" />
    </form>
}

Above is the form which I use to submit form.

EDIT:

Here is the actual code

.......

if (count($results))
            $qa_content['title']=qa_lang_html_sub('main/results_for_x', qa_html($inquery));
        else { ?>

            <form id="nosearch" method="POST" action="<?php echo qa_opt('site_url'); ?>ask" class="top-askbox" >
                    <input name="title" type="text" value="<?php echo $inquery; ?>">
            </form>
            <script>$("#nosearch").submit();</script>

        <?php }

.......

this is the part where I am working. Actual file is too long.

  • 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-12T10:24:19+00:00Added an answer on June 12, 2026 at 10:24 am

    You can use something like this

     if (is in search ) {
     //display result
    } else {
      // auto submit below form if above condition is not true ( means if no search result found )
    
        <form action="to url" id="main" method="post">
        <input name="title" type="text" value="$value" />
        </form>
    <script>$("#main").submit();</script>
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to submit search query form & get search result without redirecting/reloading/refreshing on
I have created a search form that I want to forward on submit. The
I want to have my submit button to the right of my search form.
I want to submit a form that have many checkboxes with different values, using
I have a form like this: <form action=search.php class='search' method='GET'> <input type=text/submit class=home_search_area value=Search
So what I have is a simple search form and submit button. What I
I want to submit my form after a user clicked/touched the checkbox: THE HTML
i want to submit a form using Ext.Direct and iam following all the guidelines
I want to submit a form like this: <input type=button onclick=$('#form1').submit(); value=Create /> but
I want to submit a form without page refresh using jQuery. I found some

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.