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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:05:38+00:00 2026-06-15T01:05:38+00:00

this is actually my first question ever in this awesome site. I usually find

  • 0

this is actually my first question ever in this awesome site. I usually find the answer that I need here with a little research but this time is not the case, therefore I’m forced to ask.

Here is what happens:

I’m building a search form that has one dropdown, a field and a button initially. People select from the dropdown the field (field1, field2, etc) where they want to execute the search and then type the condition in the textbox. Then there is an “OR” button that when clicked it dynamically creates another set like the one before (dropdown, textbox & “OR” button) to create a second condition for the search.

Here is the important portion of that code that inserts the button:

var divid = '#orbuttondiv'+divid;
    $(divid).after('<div id="field'+orbuttonid+'" class="blockSrc"><select name="orfield[]" id="condition'+orbuttonid+'field" class="blockSrc'+orbuttonid+'"><option value="0">Select Field</option><?php //function ?></select><input name="orstr[]" id="condition'+orbuttonid+'str" type="text" /></div><div class="orbutton" id="orbuttondiv'+orbuttonid+'"><button name="orbutton'+orbuttonid+'" id="orbutton'+orbuttonid+'" class="btn orbt" type="button" value="OR" /><i class="icon-comments-alt"></i> OR</button></div>');             
});

So the problem is that when the set is inserted in the document everything works perfectly except that the button tag is closed prematurely. What I expect is:

<div class="orbutton" id="orbuttondiv1">
<button class="btn orbt" value="OR" name="orbutton1" id="orbutton1" type="button"><i class="icon-comments-alt"></i> OR</button>
</div>

And What I’m getting is:

<div class="orbutton" id="orbuttondiv1">
<button class="btn orbt" value="OR" name="orbutton1" id="orbutton1" type="button"></button><i class="icon-comments-alt"></i> OR
</div>

Notice how the < button > tag gets closed before the contents so the < i> and the word “OR” are loaded outside of the button.

Any help will be appreciated:

  • 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-15T01:05:39+00:00Added an answer on June 15, 2026 at 1:05 am

    Because you self-closed the <button> tag:

     <button ... value="OR" /><i>...
                            ↑
    

    Just take out the slash and you’ll be on your way.

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

Sidebar

Related Questions

The first part of this question is actually a request for confirmation based on
This is actually my very first question on Stackoverflow. I hope its not the
This is my first question ever on StackOverflow, hurray! I can honestly say I
I'm very new to trigger function. Actually this is the first time I'm using
I am actually stuck in merging the result of this two queries: first query:
Simple question - what does this actually do? var oq = (ObjectQuery<TEntity>)L2EQuery; return ExecuteFirstorDefault<TEntity>(oq,
I understand that 2 options are available: Non-persistent Persistent But what does this actually
First off, this question is not what does the constructor property do? - There's
this is my first question :) I have one pile file, and I have
This is my first question, hence please ignore mistakes, if any. I have an

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.