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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:59:01+00:00 2026-06-11T08:59:01+00:00

This is my index code that I use to return the buttons parent div’s

  • 0

This is my index code that I use to return the buttons parent div’s index:

j('#optionform').index( j(this).parent() )

I’m trying to find out the DIV index of the button clicked, so I can remove the DIV.

The HTML layout is like so:

    <form id="optionform" onsubmit="return false;">
    <label><input type="checkbox" id="s_name" value="s_name"> Survey Name </label>
    <label><input type="checkbox" id="s_type" value="s_type"> Survey Type </label><br>
                    Filter Results:<br>
    <div id="template" style="display: none;">
                        Column: <select id="fcolumn[]">
                            <option></option>
    <option value="s_name">Survey Name</option>
    <option value="s_type">Survey Type</option>
    </select><br>
                        Filter Type: <select id="ftype[]">
                            <option></option>
                            <option value="=">Equals</option>
                            <option value="LIKE">Like</option>
                        </select><br>
                        Filter content: <input type="text" id="fcontent[]"><br>
    <img src="images/add.png" width="32px" onclick="addTemp(); return false;">
    <img src="images/delete.png" width="32px" onclick="alert(j(this).attr('src')); remTemp(j('#optionform').index( j(this).parent() )); return false;">
                    </div>
<div class="template" style="display: block;">
                        Column: <select id="fcolumn[]">
                            <option></option>
    <option value="s_name">Survey Name</option>
    <option value="s_type">Survey Type</option>
    </select><br>
                        Filter Type: <select id="ftype[]">
                            <option></option>
                            <option value="=">Equals</option>
                            <option value="LIKE">Like</option>
                        </select><br>
                        Filter content: <input type="text" id="fcontent[]"><br>
    <img src="images/add.png" width="32px" onclick="addTemp(); return false;">
    <img src="images/delete.png" width="32px" onclick="alert(j(this).attr('src')); remTemp(j('#optionform').index( j(this).parent() )); return false;">
                    </div>
<div class="template" style="display: block;">
                        Column: <select id="fcolumn[]">
                            <option></option>
    <option value="s_name">Survey Name</option>
    <option value="s_type">Survey Type</option>
    </select><br>
                        Filter Type: <select id="ftype[]">
                            <option></option>
                            <option value="=">Equals</option>
                            <option value="LIKE">Like</option>
                        </select><br>
                        Filter content: <input type="text" id="fcontent[]"><br>
    <img src="images/add.png" width="32px" onclick="addTemp(); return false;">
    <img src="images/delete.png" width="32px" onclick="alert(j(this).attr('src')); remTemp(j('#optionform').index( j(this).parent() )); return false;">
                    </div>
 </form>

But it always returns -1 in the index.

  • 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-11T08:59:02+00:00Added an answer on June 11, 2026 at 8:59 am

    Try $(this).parent().index(".template"), however keep in mind that your first template div has an id instead of a class. is that a typo?

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

Sidebar

Related Questions

I have a code that try to find the Eulerian path like this. But
Here in this code: $('#doneItem').click(function(){ $(this).each(function(index){ var item = 'personal' + index; alert(item); localStorage.removeItem('personal'
I have this code in my index.php. In Mozilla its ok. But in Ie
I copied this code (in spanish) http://www.elrincondelc.com/nuevorincon/index.php?pag=codigos&id=4 and wrote a new one. This is
I'm using this coffeescript code: in a spec file: index = new MeetingIndex(render: false,
I have this simple code in my user_controller.rb file #listing all users def index
When I try this code: if Verbose: print("Building internam Index for %d tile(s) ..."
i want the best regular expression to replace this code <a href=http:// www.badoobook.com/clips/index.php?page=videos&section=view&vid_id=100162> www.badoobook.com/clips/inde......&vid_id=100162
Hi guys i catch exception: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 Code look like this:
I use .data like this to pass the id of the textbox that calls

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.