Javascript |
Author: |
Message: |
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. Javascript
Can someone code me something that pops up a window when someone comes to my site, which says what is you name. and then once they've netered that, it asks for there email adress. and then everything that has been entered can be stored as text on a webpage(that i specify)
|
|
11-01-2006 04:22 PM |
|
|
Mablung
Junior Member
Posts: 19
33 / / –
Joined: Dec 2004
|
RE: Javascript
code: <html>
<head>
<script type="text/javascript">
var name=prompt("Please enter your name","")
var email=prompt("Please enter your email","")
if (name!=null && name!="" && email!=null && email!="")
{
document.write("Name: " + name + "<br>Email: " + email)
}
</script>
</head>
<body>
</body>
</html>
http://w3schools.com/js/tryit.asp?filename=tryjs_prompt
|
|
11-01-2006 05:13 PM |
|
|
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. RE: Javascript
quote: Originally posted by Mablung
code: <html>
<head>
<script type="text/javascript">
var name=prompt("Please enter your name","")
var email=prompt("Please enter your email","")
if (name!=null && name!="" && email!=null && email!="")
{
document.write("Name: " + name + "<br>Email: " + email)
}
</script>
</head>
<body>
</body>
</html>
http://w3schools.com/js/tryit.asp?filename=tryjs_prompt
Looks like it will work, but where can i specify where it saves the names and email addresses, or can they be sent to an email?(mine)
|
|
11-01-2006 05:17 PM |
|
|
Mablung
Junior Member
Posts: 19
33 / / –
Joined: Dec 2004
|
RE: Javascript
I can't do it with JavaScript (AFAIK), you have to use PHP or ASP.
|
|
11-01-2006 05:22 PM |
|
|
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. RE: Javascript
quote: Originally posted by Mablung
code: <html>
<head>
<script type="text/javascript">
var name=prompt("Please enter your name","")
var email=prompt("Please enter your email","")
if (name!=null && name!="" && email!=null && email!="")
{
document.write("Name: " + name + "<br>Email: " + email)
}
</script>
</head>
<body>
</body>
</html>
http://w3schools.com/js/tryit.asp?filename=tryjs_prompt
so what will this actually do?
|
|
11-01-2006 05:23 PM |
|
|
Mablung
Junior Member
Posts: 19
33 / / –
Joined: Dec 2004
|
RE: Javascript
It will ask you for your name and email and if you enter them they will be written on the page.
|
|
11-01-2006 05:25 PM |
|
|
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. RE: Javascript
quote: Originally posted by Mablung
It will ask you for your name and email and if you enter them they will be written on the page.
Will they be saved on the page, or just viewable by the person that entered them?
|
|
11-01-2006 05:27 PM |
|
|
Mablung
Junior Member
Posts: 19
33 / / –
Joined: Dec 2004
|
RE: Javascript
Just viewable.
|
|
11-01-2006 05:28 PM |
|
|
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. RE: Javascript
quote: Originally posted by Mablung
Just viewable.
Is there any way to save it? or do you have to use PHP or ASP.
|
|
11-01-2006 05:34 PM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
RE: Javascript
quote: Originally posted by Jimbodude
quote: Originally posted by Mablung
Just viewable.
Is there any way to save it? or do you have to use PHP or ASP.
You'll need PHP or ASP. If you want PHP code i can give it to you.
|
|
11-01-2006 05:38 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|