Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts
    what way do you advise to do that?
    I thought to use ajax that I have to do it in that way

  2. #17
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,446
    Thanks
    23
    Thanked 630 Times in 629 Posts
    This may sound funny, but what are you trying to do?

    Right now you have a submit button and a delete button; both doing the same thing.
    Do you want the submit to submit the form?
    And the delete button, 'I'm guessing', remove the option "chicago"?
    Or does the delete button do something else?


    Ajax = right now you have it returning a word. It returns the same word all the time. You don't need ajax to do that. That's why I need to know what you are tring to do.
    Last edited by sunfighter; 05-30-2014 at 01:40 AM.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  3. #18
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts
    I just want the delete button to give a confirm with the name of the city asking if they really want to delete

  4. #19
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts
    I just want the delete button to give a confirm with the name of the city asking if they really want to delete -- by the way now city.html is html but I will change it to asp returning the correct city from my database
    I simplified it to get the test working which is not

  5. #20
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Chris

    Indifference will be the downfall of mankind, but who cares?

  6. #21
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts
    I need to javascript to get the name (city.html will be city.asp)

    why would this not work on my web server but work locally?

  7. #22
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Have you tried tried without having two modal dialogues interrupting the process (alert and confirm)


    And you are not capturing the return value from confirm() so effectively all you have is two "alert()" dialogues.
    Chris

    Indifference will be the downfall of mankind, but who cares?

  8. #23
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts
    no I only need one - I need the confirm and that didn't work

    what is the best way to do this?

  9. #24
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Catching the returned value from the confirm dialogue would be a good start, that why I linked to the W3Schools URL that shows how to use it correctly.
    Chris

    Indifference will be the downfall of mankind, but who cares?

  10. #25
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts
    I don't understand how that helps

  11. #26
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,446
    Thanks
    23
    Thanked 630 Times in 629 Posts
    Quote Originally Posted by esthera View Post
    I need to javascript to get the name (city.html will be city.asp)

    why would this not work on my web server but work locally?
    No you don't! You can get it from the choice the user makes and JS, not JQ, is perfect for it.
    I would make my own shadowbox and not use the confirm():

    Code:
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta charset="UTF-8" />
    <title>Title of the document</title>
    </head>
    
    <body>
    <form id="my_form" method="post" action="nihul.asp">
    <b>Delete City: </b>
    <select name="city" id="city">
    	<option value='544'>Chicago</option>
    	<option value='1'>New York</option>
    	<option value='2'>Albany</option>
    </select>
    </form>
    <button onclick="cityconfirm();">Edit</button>&nbsp;&nbsp;
    <button onclick="remove();">Delete</button>
    
    <script>
    function remove(){
    	var city_name = document.getElementById("city");
    	var chce = confirm("Confrim that you wish to remove "+city_name.options[city_name.selectedIndex].text+" from the dropdown list");
    	if(chce == true){
    		city_name.remove(city_name.selectedIndex);
    	}
    }
    </script>
    
    </body>
    </html>
    See if your site will run this.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  12. #27
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by esthera View Post
    I don't understand how that helps
    Well if you actually want the end user to choose yes or no, you don't have a choice, otherwise you may as well not ask the question.
    Chris

    Indifference will be the downfall of mankind, but who cares?

  13. #28
    New to the CF scene
    Join Date
    Jun 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Got any solution?

    Hello,

    Looking for the same solution. Can you help me?

    Thanks...

  14. #29
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,446
    Thanks
    23
    Thanked 630 Times in 629 Posts
    Quote Originally Posted by merryjonson111 View Post
    Hello,

    Looking for the same solution. Can you help me?

    Thanks...
    Start you own thread with your information
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  15. #30
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts
    I did in the end without jquery --
    but I still would like to understand why I couldn't return the value from jquery


 
Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •