View Full Version : new to this (prompts)

01-09-2007, 07:21 PM
Im so new to this, i have a book ect, but am struggling, i need to get a prompt up when i click a button, can anyone help, basic i know but im stuck

01-09-2007, 07:32 PM
what type of button, and what do you want the prompt to say, or do?

Imperial Spider

01-09-2007, 08:12 PM
well basically i want a prompt to appear when the button is pressed with text saying enter a city below or summit like that, i can do the rest i think lol, i just cannot get the damn button to open a prompt

01-09-2007, 08:44 PM
<input type="button" value="Submit" onClick="alert('You forgot to enter a City.');">

Hope this is what you are looking for.

Imperial Spider

Philip M
01-09-2007, 08:49 PM
<Script type = text/javascript>
function getName() {
var city = prompt ("Please enter the name of a city.....", "");
if (city.length<4) { // ensures city name at least 4 characters length
city = prompt ("Please try again.....", "");
if (city.length <4) {
getName(); // go round again until a valid response is given

<Input type = "button" name= "button1" value = "Enter your city" onclick="getName()">

Do please write English. There is no need to advertise poor literacy.

01-09-2007, 08:51 PM
thanks for the help, perfect!
cheers dude