user3676578
user3676578

Reputation: 223

How to close a pop_up for all the time when click on close button on pop_up?

1) listing.html.erb

<a class="book_btn" role="button" href="/web/sign_in_user?onward_schedule_id=<%=onward_schedule_id%>&return_schedule_id=<%=return_schedule_id%>&return_date=<%=params[:return_date]%>&is_from_book_link=true" data-toggle="modal" data-target="#popup_div" data-remote="true"> Book </a>

2) On click of Book one pop_up is coming.

3) On Pop_up one close button is there. When user will click on close button pop_up will go off.

4) But When user again click on Book button pop_up should not come, instead of pop_up it should proceed next.

Upvotes: 0

Views: 44

Answers (1)

Yunus Aslam
Yunus Aslam

Reputation: 2466

Suppose when the user clicks on the close button, that time remove some attributes from the button tag. Like this

$("close_button").click(function(){
    // Here the code which will close your popup and then
    $(".book_btn").removeAttr("data-toggle").removeAttr("data-target");
});

The above line will permanently remove these attributes so the pop up will not show for that user again and will process next.

Just give a try and see what happens.

Upvotes: 3

Related Questions