Results 1 to 3 of 3

Thread: Javascript VERY newbie

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    It's window.prompt("message", "default"), where message is the text on the box, default is the default text in the user input area. It returns the string the user typed, an empty string if they didn't type anything, and null if they clicked cancel.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  2. #2
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343
    Hi Josh,

    Thanks for this!! How can I now store whatever the user entered in a variable so that I can use it again later eg. after the user enters whatever into the textbox I want to now do something like alert(var1) - where var1 is what the user entered.

    Also, how can I change the input box NOT to have the OK,CANCEL and the text "Explorer user prompt" and "Javascript Prompt" on it. Can I also determine the size of the box as well as where it's positioned on the screen.

    Thanks,
    T

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Code:
    var1 = prompt("blah blah", "NO!");
    alert(var1);
    I don't think you can change much to the prompt. Some of the text is put there for security reasons (actually, so you can't trick ignorant users).
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

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



Click Here to Expand Forum to Full Width