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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:59:50+00:00 2026-05-23T17:59:50+00:00

I am trying to add a submit and a clear button to a quicksearch

  • 0

I am trying to add a submit and a clear button to a quicksearch form in flexigrid. At the moment, when a user searches, they have press the enter key (13). So in conjunction with that, I would also like buttons that search and clear. I know I did this before, but cannot find the code after a restore. Many thanks

//add search button
if (p.searchitems) {
    $('.pDiv2', g.pDiv).prepend("<div class='pGroup'> <div class='pSearch pButton'><span></span></div> </div>  <div class='btnseparator'></div>");
    $('.pSearch', g.pDiv).click(function () {
        $(g.sDiv).slideToggle('fast', function () {
            $('.sDiv:visible input:first', g.gDiv).trigger('focus');
        });
    });
    //add search box
    g.sDiv.className = 'sDiv';
    var sitems = p.searchitems;
    var sopt = '', sel = '';
    for (var s = 0; s < sitems.length; s++) {
        if (p.qtype == '' && sitems[s].isdefault == true) {
            p.qtype = sitems[s].name;
            sel = 'selected="selected"';
        } else {
            sel = '';
        }
        sopt += "<option value='" + sitems[s].name + "' " + sel + " >" + sitems[s].display + "&nbsp;&nbsp;</option>";
    }
    if (p.qtype == '') {
        p.qtype = sitems[0].name;
    }
    $(g.sDiv).append("<div class='sDiv2'>" + p.findtext + 
            " <input type='text' value='" + p.query +"' size='30' name='q' class='qsbox' /> "+
            " <select name='qtype'>" + sopt + "</select></div>");
    //Split into separate selectors because of bug in jQuery 1.3.2
    $('input[name=q]', g.sDiv).keydown(function (e) {
        if (e.keyCode == 13) {
            g.doSearch();
        }
    });
    $('select[name=qtype]', g.sDiv).keydown(function (e) {
        if (e.keyCode == 13) {
            g.doSearch();
        }
    });
    $('input[value=Clear]', g.sDiv).click(function () {
        $('input[name=q]', g.sDiv).val('');
        p.query = '';
        g.doSearch();
    });
    $(g.bDiv).after(g.sDiv);
}
  • 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-23T17:59:50+00:00Added an answer on May 23, 2026 at 5:59 pm

    ok you can try something simple like that :

    $('.sDiv2').append("<input type='submit' value='submit' name='submit' /><input type='reset' value='reset' name='reset' />");
    

    After you set listeners like you did for the others input

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

Sidebar

Related Questions

I am trying to add points to a User's profile after they submit a
I have a simple form. Its got one field and a submit button. I
I am trying to submit a zend form. When I click the button to
im trying to add a new user to my database via a form i
I am trying to add a gradient to a submit button in IE9 using
Quick question, I'm trying to add a rollover effect to a submit button, but
Trying to add a 'box' to a form at design time, I looked up
Im trying to add a Jquery validation script to a form plugin for wordpress.
i trying to add some costume app into Dynamics CRM basically i have an
I'm trying to add some validation to some form fields in a jQuery Mobile

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.