Friday, May 20, 2011

box_prompt() method

The box_prompt() method displays a popup box containing a text box. You can use this for certain actions in your site such as the user entering his or her name, or for another purpose. There is a parameter in which you can enter coding to control the result. To display text entered into the prompt box, add the object "str_rslt".

Browser support: all
Original TheMadScript Version: 1.0.0
Newer version: Version 2.0.0

Syntax: box_prompt(message,defaultValue,result);

The following syntax below creates a prompt box that asks for your name and has a default name in the box awhile, and displays a welcome message in an alert box afterwards:

box_prompt("Please enter your name.","John Doe","box_alert('Hello, '+str_rslt+'!");

No comments:

Post a Comment