<code>Does anyone know how do I go about getting user's responces once they've entered their responce into a prompt box & assign it to a variable, to utlimately use their responces to concatenate it with other strings to make a sentence. I'm just having trouble assinging user's input to be embedded in my Javascript program. Please help:sad: </code>

Recommended Answers

All 3 Replies

Not sure what you mean
Did you try
var x=prompt("some question","");

Not sure what you mean
Did you try
var x=prompt("some question","");

I'm required to go through a javascript course as one of my requirements to for major, although I'm not looking to be a computer programmer but. . . go figure they want me to go through pain :sad: - Anyhow, I was writing an html program that includes javascript in the body and had to create a prompt box to asks the user what is his/her name. Once the user typed in their name in the prompt box I am having trouble using whatever the user typed into the prompt box to tie it to a sentence that I want to use in my alert box. Like how do I tell the computer in javascript to go get the value the user entered in as their first_name to concatenate it in an alert box with
first_name + last_name. Can someone help?!Please let me know
PatriciaN20@yahoo.com

By using the x variable pointed out in the first reply. If this is going to become a long-winded thread, then I feel obliged to point out something else that I feel you have not grasped. That is JavaScript != Java. JavaScript and Java are two different things. They have somewhat similar syntax, but they are not the same. Find a JavaScript forum, or (as a last resort) an HTML forum. You will get much better help there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.