Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Multiple Prompts?

Maybe I am jumping ahead...but is it possible to write multiple prompts, categorize the variable responses like in a form? If so, what is the proper syntax? For example: var visitor= prompt("What is your name?"); var schedule= prompt ("What day are you interested in booking?"); var staff= prompt("Who would you like to see?");

How can you combine multiple prompts into one prompt, like a form?

4 Answers

This is not possible with an OS or native browser window popping up. You will have to create a custom overlay dialog.

Thanks so much Sergey!

You are welcome ;)

Is there documentation on how to create an overlay dialog? Is that HTML?

I would advise using a library like jQuery UI to do this. You can then customize whatever is in the popup.

Example of using modal dialogs with overlay, you can find here - http://jquerytools.github.io/demos/overlay/modal-dialog.html

If you have just started to learn web development, I suggest first learn well JavaScript

I have just started. I will take your advice and not jump ahead.