Results 1 to 2 of 2

Thread: Cancel button on javascript prompt

  1. #1
    Join Date
    Oct 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Cancel button on javascript prompt

    Hi All;
    i am using the JavaScript prompt to get user input with default value when this prompt comes with a default value in the input box now at this point if the user say cancel the process does not cancel the process the value always comes true in if condition because of default value can we do something that even if the input box has a value and if user click cancel the process should be cancel ???

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Show us your code. But first check here:

    http://www.w3schools.com/jsref/met_win_prompt.asp

    And make sure you are using it properly. Notice the if test which is used to determine whether or not the user has canceled.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. cancel key enter
    By actionM in forum JavaScript
    Replies: 1
    Last Post: 04-15-2010, 09:55 PM
  2. Cancel Tab key action
    By forum_amnesiac in forum JavaScript
    Replies: 7
    Last Post: 04-30-2009, 08:39 AM
  3. DHTML Modal Window - Cancel Button
    By greddin in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-29-2008, 02:16 AM
  4. problem during Cancel the text editing in place
    By giselle2008 in forum JavaScript
    Replies: 0
    Last Post: 06-05-2008, 10:00 AM
  5. Replies: 23
    Last Post: 07-23-2006, 10:24 PM

Bookmarks

Posting Permissions

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