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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:10:32+00:00 2026-06-01T11:10:32+00:00

I am trying to create a popup for a search box and submit the

  • 0

I am trying to create a popup for a search box and submit the keyword
with a form. I browse similar questions on the internet but the only solution I applied is
deleting submit element of the form. It didn’t work out neither; any ideas?

Working on django and I can provide more details.

Some part of my JavaScript looks like this:

$( "#dialog-form" ).dialog({
   autoOpen: false,
   height: 200,
   width: 200,
   modal: true,
   buttons: {
       "Search": function() {
           var bValid = true;
           allFields.removeClass( "ui-state-error" );

           bValid = bValid && checkLength( keyword, "username", 2, 16 );

           bValid = bValid && checkRegexp( keyword, /^[a-z]([0-9a-z_])+$/i, "Keyword may consist of a-z, 0-9, underscores, begin with a letter." );

           if ( bValid ) {
               document.getElementById('searchForm_1_keyword').value =  keyword.val();
               document.getElementById('searchForm').submit(); //if I comment out this line it continues the next line, if not, it does not execute the next line
                                            

                $( "#testDiv" ).append( "<tr>" +
                "<td>" + keyword.val() + "</td>" +
                "</tr>" );

                 alert(keyword.val());
                 $( this ).dialog( "close" );
           }
       },
       Cancel: function() {
           $( this ).dialog( "close" );
       }
   },
   close: function() {
       allFields.val( "" ).removeClass( "ui-state-error" );
   }
});

and html looks like this:

<div class="searchBox">
     <form id='searchForm' method="POST" action="/dasdasasdas/" >{% csrf_token %}
        <input type="text" name="column_name" value='supplier_name'>
        <input type="text" name="keyword" id="searchForm_1_keyword" value=""/>
     </form>
</div>

and these are my jQuery files :

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>

FOUND THE SOLUTION!

I made a rookie mistake. I had nested forms. When I correct that mistake, it does work.

  • 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-01T11:10:34+00:00Added an answer on June 1, 2026 at 11:10 am

    Why are you using

    document.getElementById('searchForm').submit()
    

    when you have access to jQuery? You could do this instead:

    $("#searchForm").submit()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to create a custom combo box component but I've been having
I have been trying to search for a solution, but with very little success.
I'm trying to create a popup window that only appears the first time the
I was trying to create a popup logon form for a site I'm working
I am trying to create popup using the jqueryui dialog. I am trying to
I'm trying to create a popup for which I am using jQuery's CSS function.Here's
I'm trying to create a dynamic popup window that is able to be re-sized.
I'm trying to create a wx.Menu that will be shared between a popup (called
I have a simplr svg-graph and I'm trying to create a simple tooltip-popup for
I am trying to create a popup when my link is clicked. I have

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.