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

  • Home
  • SEARCH
  • 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 7952887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:59:48+00:00 2026-06-04T02:59:48+00:00

i have a page , with a link , if the user click the

  • 0

i have a page , with a link , if the user click the link , a new select tag will be appear , and left the that select , there will be a delete link , if the user click it , the select tag will disappear

my problem is when i click to create a new select and then click to delete it , really it doesn’t be deleted , it is just hidden , i don’t want that cos after submitting i check if a new select is set , so i get true cos it is just hidden not deleted, how to solve that please

html code

<div class="container" id="addCell">
    <form method="POST" action="<?php echo URL; ?>Cell/addCell">
        <ul>
            <li>
                <p>
                    <label>Name</label>
                    <input type="text" name="name"class="longInput1"/>
                <p>
                <p>
                    <label>City</label>
                    <select id="countrySelector" name="city">
                    </select>
                </p>
            </li>
            <li>
                <p>
                    <label>Inserted cells</label>
                    <a href="#" class="smallLink" id="acaclink">new</a>
                </p>
            </li>
            <li>
                <input type="submit" class="button1" value="save"/>
            </li>
        </ul>
    </form>
</div>

database code

public function addCell() {
        $cellName = $_POST['name'];
        $cityName = $_POST['city'];
        $this->model->addCell($cellName, $cityName);
        if (isset($_POST['acSelect'])) {
            $cells = $_POST['acSelect'];
            $cellID = $this->model->getCellID($cellName);
            $this->model->insertIntersectionCells($cellID, $cells);
        }
        include_once 'Successful.php';
        $s = new Successful();
        $s->index("you inserted your cell");
    }

$jquery code#

$("#addCell").ready(function(){
    $("#addCell").on('click',"#acaclink",function(){
        var me = this;
        $.getJSON("http://localhost/Mar7ba/Cell/getAllCells/TRUE",function(data){
            var options = '';
            options+="<option>select cell</option>";
            for(var i=0;i<data.length;i++){
                options += "<option>"+data[i]+"</option>";
            }
            $(me).closest('li').append('<p>\n\
            <label>Select Cell</label>\n\
            <select name="acSelect[]">\n\
             '+options+'\n\
</select>\n\
<a href="#" class="removeA">delete</a>\n\
</p>');
        });
    });
});
$("#addCell").ready(function(){
    $("#addCell").on('click',".removeA",function (){
        $(this).closest('p').hide();
    });
});

i hope i could explain my question cos my english is bad

  • 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-04T02:59:50+00:00Added an answer on June 4, 2026 at 2:59 am

    you can use remove() method:

    $("#addCell").ready(function(){
        $("#addCell").on('click',".removeA",function (){
            $(this).closest('p').remove();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have html page with a link when user clicked that link a new
I have a link on a page that pops up a new window, and
hi i have a page contains a link , when user click the link
I have a subscription link on a page that the logged in users can
I have a page that contains a user control that is just a personalized
I would like to have a page that would contain: hyperlik Add new country.
i am new user to php and i have a html page which is
I have a page in which i have provided a link clicking on which
I have a page index.php where i have a link called add_users.php. In add_users.php,
This may sound a weird question, I have a page which has a link:

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.