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
Lia Lee
Courses Plus Student 1,030 PointsMultiple 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
Sergey Podgornyy
20,660 PointsThis is not possible with an OS or native browser window popping up. You will have to create a custom overlay dialog.
Lia Lee
Courses Plus Student 1,030 PointsThanks so much Sergey!
Sergey Podgornyy
20,660 PointsYou are welcome ;)
Lia Lee
Courses Plus Student 1,030 PointsIs there documentation on how to create an overlay dialog? Is that HTML?
Sergey Podgornyy
20,660 PointsI 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
Sergey Podgornyy
20,660 PointsIf you have just started to learn web development, I suggest first learn well JavaScript
Lia Lee
Courses Plus Student 1,030 PointsI have just started. I will take your advice and not jump ahead.