1

Is there any alternative to a pop up dialog box with a text box with OK and cancel button.

I tried window.prompt but its not working on my custom defined webkit browser but working on Mozilla and others.

   function Add() {

        var reg = /^[a-zA-Z0-9_-]+$/;
        var newName = window.prompt("New Recipe");
        //Check for alphanumeric and 2 special charaters
        if(!reg.test(newName)) {
            window.alert("only alpha numeric"); 
            return false; 
        }
        if((reg.test(" "))||(newName.length == 0)) {
            return false;
        }
 }
XXDebugger
  • 1,581
  • 3
  • 26
  • 48
  • What webkit browser are you using? What is in `window` if you type it in console? Have you tried just `prompt()` ? – elzi Nov 06 '14 at 23:20
  • 1
    What is your "custom defined webkit browser"? –  Nov 06 '14 at 23:21
  • this has been asked before, refer to this: http://stackoverflow.com/questions/11905294/alternative-to-javascript-prompt-box – zackify Nov 06 '14 at 23:21

0 Answers0