Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to handle prompt in javascript

 
Raaja Gotluru
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written the script like this



Here if the user wont enter filename and clicks ok or he presses cancel button with or without entering filename the alert box will popup. I dont want this. what I want is if the user presses canel it should return false and if the user clicks ok without entering filename then it should alert and return false. How to handle this can anybody guide me to achieve this.

Thanking you.
raaja. g
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to detect if cancel was clicked.

Also length==0 is the same thing as value=""

Eric

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic