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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:49:52+00:00 2026-06-14T07:49:52+00:00

I have a stackoverflow-style tag box, and it works fine except it won’t submit

  • 0

I have a stackoverflow-style tag box, and it works fine except it won’t submit the tag values when the form submits. The url just comes out as ‘/?tags=’. I can’t think what’s wrong. Any ideas?

$(".tag_field").each(function() {
  var buttons = $("<div/>");
  var input = $(this).find("input[type=text]"); /* locate element input type text */
  var output = $(this).find("input[type=hidden]"); /* locate element input type text */

  var update_padding = function() {
      input.css("padding-left", buttons.width() + 2); 
  };       
  setInterval(update_padding, 300);

  $(this).prepend(buttons);
  buttons.addClass("tag_buttons");
  buttons.css({ left: input.offset().left + 1,
                top: input.offset().top + 2 });
  input.bind("keyup change paste", function() {
    var i = input.val().indexOf(",");
    if (i >= 0) {
      var new_tag = input.val().substr(0, i);
      input.val(input.val().substr(i+1));
      buttons.append("<div id='button'><span class='value'>"+new_tag+"</span> <span class='close'>(x)</span></div>");
    }
  });

  var form = $(this).closest("form");
  if (form.length > 0) {
    form.submit(function() {
      var v = [];
      form.find(".tag_buttons div").each(function() {
        v.push($(this).find(".value").html());      
      });

      output.val(v.join(","));
      return false;
    });          
  }

});

The HTML is as follows:

<form method="get"> <!-- renders to same page -->
    <div class="row">
        <div class="twelve columns tag_field">
             <input type="text">  
             <input type="hidden" name="tags">
        </div>
    </div>
    <input type="submit" value="Apply Filters"> 
</form>
  • 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-14T07:49:53+00:00Added an answer on June 14, 2026 at 7:49 am

    As per Blender’s comment, I did return false at the end so the submit event didn’t fire.

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

Sidebar

Related Questions

i want to make a text box like stackoverflow have for the tag at
I'm still having problems with loading the style sheet for these pages. Works fine
I have a stackoverflow style comment system where there are a variable number of
I would like to use this style of tool tip (stackoverflow comments form on
What is the best way to implement a StackOverflow-style Recent Activities page? I have
I'm trying to style a simple a tag to have a preceding icon which
I have a webpage, lets take for example StackOverflow. every box looks like this:
I have searched stackoverflow for a question like mine but most of the questions
I have seen stackoverflow ask question page they disable button until my postback event
i need to put the page no like stackoverflow have at the tags page

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.