PDA

View Full Version : Answer of an alert, into webpage



Sweeper Steve
03-09-2005, 09:03 PM
I have made an alert on my webpage, where it asks the user for its name.

Is there any way of transferring this name given in an alert, into the normal body of the webpage?

Thanks,
Steve

TheBigT
03-10-2005, 03:34 AM
Yeah... Just put this code wherever you need the name to be.
If you know any javascript even simple you know what to edit and what not to edit and such its a pretty simple thing.


<script>
var name=prompt("TYPE WHAT WILL BE IN YOUR POPUP HERE","");
function dispname(name) {
document.write(""+name+"");
}
</script>

TheBigT
03-10-2005, 03:35 AM
Oh and one last thing delete the script that makes the other popup window because this one already has the popup window there.

Sweeper Steve
03-10-2005, 03:48 PM
Thanks, works a treat, you don't know if theres any way of including a drop down menu IN THE ALERT do you?

If it's too hard it doesn't matter...i just wondered

Thanks,
Steve

TheBigT
03-10-2005, 10:51 PM
I don't think you can put a drop down menu in a pop-up menu unless you make a pop-up a new window instead of making it a pop-up. You follow?

Sweeper Steve
03-11-2005, 07:47 AM
Yeah, i thought so.

I'm just gonna link the drop-down in the base of the webpage i think...

Thanks anyway,
Steve

Sweeper Steve
03-11-2005, 06:50 PM
I'm back :)

I've made the site where it asks you this survey thing.....but when they click "Submit" i want to record the data they entered somewhere on my pc, does anybody know how i would i do this?

I'd really appreciate that,

Thanks,
Steve

TheBigT
03-11-2005, 10:29 PM
Is it a form or stuff they enter into a popup box? If it is a pop up box then I can help you and if it is in a form on your page I can help you. So I am pretty sure I can help. There is one thing that you have to do though and that is sign up for this: http://allforms.mailjol.net/main.html I use this for my forms because my webserver does not support any servide scripting but if yours does you can avoid this but I can't help you with that... I can get it all set up and ready to work you just need to get the form processor to work.

Sweeper Steve
03-12-2005, 11:15 AM
Yeah, it's a form.

somebody told me to put <FORM="mailto: email@domain"> or something like that, but i tried it and they didn't get delivered to my inbox.

Are you on MSN?

Thanks,
Steve.

TheBigT
03-12-2005, 02:22 PM
Ok let me first explain why you are having trouble. If you were to use that code it would look like this instead of that

<form action="mailto:yourname@yourdomain.com" method="post">
Now the problem with that is that it opens up the users default email, like outlook and so forth. That way if the user does not want to send the email they do not have to send it. Here is an example of one code I have on my page DO NOT USE THIS BECAUSE THE RESULTS WILL BE SENT TO ME. I put this in the heading and the second one in the body of the page. The script in the heading also validates to see if the form is filled out correctly.

<script>
<!--
function validate()
{
if ((document.feedback.email.value=="")||
(document.feedback.suggestion.value==""))
{
alert ("Please fill out every field. Thank you.")
return false ;
}
return true ;
}
//-->
</script>

<center>
<form action="http://free.allforms.mailjol.net/u/102067.php" method="post" name="feedback" onsubmit="return validate()">
Enter Your Name<br>
<input type="text" size="20" name="name">
<br>
Enter Your E-Mail (*required)<br>
<input type="text" size="20" name="email">
<br>
What you want up here: (*required)
<br>
<textarea name="suggestion" rows="3" cols="25"></textarea>
<br>
<input type="submit" name="B1" value="Submit">
</form>
</center>

Now that is what I have. Can I get a copy of the code for your form that you are using. The entire form. Also you have to sign up for that website I gave you. That is how I send all my forms.

Sweeper Steve
03-13-2005, 12:15 PM
Yeah, here is all of the form....

__________________________________________________________________________


<FORM>

<table border="1" width="100%">
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>What's your
full name?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><input type="text" name="T1" size="42" style="font-family: Comic Sans MS; color: #0000FF; font-weight: bold"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Age?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><input type="text" name="T2" size="5" maxlength="3" style="color: #0000FF; font-family: Comic Sans MS; font-weight: bold"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Sex?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b>Male&nbsp; <input type="radio" name="R1" value="V3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Female <input type="radio" name="R1" value="V2"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>What are your
interests? (Please press &quot;Enter&quot; after each interest)</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><textarea rows="2" name="S1" cols="20" style="color: #0000FF; font-family: Comic Sans MS; font-weight: bold"></textarea></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Which one of
these best describes you?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question" style="color: #FF0000; font-family: Arial Narrow; font-weight: bold">
<option selected>Please select...</option>
<option>Sporty</option>
<option>Plays sport quite often</option>
<option>Plays sport sometimes</option>
<option>Hardly ever plays sport</option>
<option>Never plays sport</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Tick your
favourite tennis player/s.</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b>Tim Henman <input type="checkbox" name="C1" value="ON">&nbsp;&nbsp;
Greg Rusedski <input type="checkbox" name="C2" value="ON">&nbsp;&nbsp;
Andre Agassi <input type="checkbox" name="C3" value="ON">&nbsp; Lindsay
Davenport <input type="checkbox" name="C4" value="ON">&nbsp;&nbsp; Roger
Federer <input type="checkbox" name="C5" value="ON">&nbsp;&nbsp; Serena
Williams <input type="checkbox" name="C6" value="ON">&nbsp;&nbsp; Venus
Williams <input type="checkbox" name="C7" value="ON">&nbsp;&nbsp; Other <input type="checkbox" name="C8" value="ON"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>What is your
favourite tennis brand?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question2" style="color: #FF0000; font-family: Arial Narrow; font-weight: bold">
<option>Please select...</option>
<option>Wilson</option>
<option>Slazenger</option>
<option>Donnay</option>
<option>Head</option>
<option>Dunlop</option>
<option>Prince</option>
<option>Other</option>
<option>N/A</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>How often do
you play tennis?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question2" style="color: #FF0000; font-family: Arial Narrow; font-weight: bold">
<option>Please select...</option>
<option>0-1 hours per week</option>
<option>&gt;1-2 hours per week</option>
<option>&gt;2-3 hours per week</option>
<option>&gt;3-4 hours per week</option>
<option>&gt;4-5 hours per week</option>
<option>&gt;5-6 hours per week</option>
<option>&gt;6-7 hours per week</option>
<option>&gt;7-8 hours per week</option>
<option>&gt;8-9 hours per week</option>
<option>&gt;9-10 hours per week</option>
<option>&gt;10 hours per week</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Do you own a
tennis racket?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b>Yes <input type="radio" name="R2" value="V4">&nbsp;&nbsp;&nbsp;
No <input type="radio" name="R2" value="V5"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>If so, please
indicate the brand of the racket. If you do not own a tennis racket,
please select 'N/A'</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question4" style="color: #FF0000; font-family: Arial Narrow; font-weight: bold">
<option>Please select...</option>
<option>Wilson</option>
<option>Slazenger</option>
<option>Donnay</option>
<option>Head</option>
<option>Dunlop</option>
<option>Prince</option>
<option>Other</option>
<option>N/A</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>What brand of
tennis balls do you use most often? (If you don't play tennis, please
select N/A)</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question5" style="font-family: Arial Narrow; color: #FF0000; font-weight: bold">
<option>Please select...</option>
<option>Wilson</option>
<option>Slazenger</option>
<option>Donnay</option>
<option>Head</option>
<option>Dunlop</option>
<option>Prince</option>
<option>Other</option>
<option>N/A</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Finally,
what's your email?</b></font></td>
<td width="60%"><input type="text" name="T3" size="37" style="font-family: Comic Sans MS; color: #0000FF; font-weight: bold"></td>
</tr>
</table>
<font face="Comic Sans MS"><p align="center"><font color="#006633"><a href="http://www.google.co.uk">Rate Me!</a></p></font>
</font></form>

_________________________________________________________________________


(P.S at the moment, the link where you get sent to www.google.co.uk will be this "Rating" page, which i will make later on. I would like [on click of "Rate Me!"] to be sent to another page, [google at the moment] and i would also like it to be the "Submit" kind of button, so the data is sent to me.)

I think the <FORM ACTION...> you said was the one i got sent, it just never had the "method" bit.

Thanks,
(my emails stevenleecutler@hotmail.com if you want to email me)

TheBigT
03-13-2005, 05:30 PM
Alright first off sign up for that link. You had a couple mispelled words I corrected them. You don't have a submit button but I will build that into the rate me link... which will be a submit function too. Now when you sign up for that site you can make the redirect page what you want... I finished setting up your form which really didn't take long.



<form action="THEPAGE THE WEBSITE GIVES YOU" method="post" name="tennis">

<table border="1" width="100%">
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>What's your
full name?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><input type="text" name="T1" size="42" style="font-family: Comic Sans MS; color: #0000FF; font-weight: bold"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Age?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><input type="text" name="T2" size="5" maxlength="3" style="color: #0000FF; font-family: Comic Sans MS; font-weight: bold"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Sex?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b>Male&nbsp; <input type="radio" name="R1" value="V3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Female <input type="radio" name="R1" value="V2"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>What are your
interests? (Please press &quot;Enter&quot; after each interest)</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><textarea rows="2" name="S1" cols="20" style="color: #0000FF; font-family: Comic Sans MS; font-weight: bold"></textarea></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Which one of
these best describes you?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question" style="color: #FF0000; font-family: Arial Narrow; font-weight: bold">
<option selected>Please select...</option>
<option>Sporty</option>
<option>Plays sport quite often</option>
<option>Plays sport sometimes</option>
<option>Hardly ever plays sport</option>
<option>Never plays sport</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Tick your
favorite tennis player/s.</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b>Tim Henman <input type="checkbox" name="C1" value="ON">&nbsp;&nbsp;
Greg Rusedski <input type="checkbox" name="C2" value="ON">&nbsp;&nbsp;
Andre Agassi <input type="checkbox" name="C3" value="ON">&nbsp; Lindsay
Davenport <input type="checkbox" name="C4" value="ON">&nbsp;&nbsp; Roger
Federer <input type="checkbox" name="C5" value="ON">&nbsp;&nbsp; Serena
Williams <input type="checkbox" name="C6" value="ON">&nbsp;&nbsp; Venus
Williams <input type="checkbox" name="C7" value="ON">&nbsp;&nbsp; Other <input type="checkbox" name="C8" value="ON"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>What is your
favorite tennis brand?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question2" style="color: #FF0000; font-family: Arial Narrow; font-weight: bold">
<option>Please select...</option>
<option>Wilson</option>
<option>Slazenger</option>
<option>Donnay</option>
<option>Head</option>
<option>Dunlop</option>
<option>Prince</option>
<option>Other</option>
<option>N/A</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>How often do
you play tennis?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question2" style="color: #FF0000; font-family: Arial Narrow; font-weight: bold">
<option>Please select...</option>
<option>0-1 hours per week</option>
<option>&gt;1-2 hours per week</option>
<option>&gt;2-3 hours per week</option>
<option>&gt;3-4 hours per week</option>
<option>&gt;4-5 hours per week</option>
<option>&gt;5-6 hours per week</option>
<option>&gt;6-7 hours per week</option>
<option>&gt;7-8 hours per week</option>
<option>&gt;8-9 hours per week</option>
<option>&gt;9-10 hours per week</option>
<option>&gt;10 hours per week</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Do you own a
tennis racket?</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b>Yes <input type="radio" name="R2" value="V4">&nbsp;&nbsp;&nbsp;
No <input type="radio" name="R2" value="V5"></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>If so, please
indicate the brand of the racket. If you do not own a tennis racket,
please select 'N/A'</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question4" style="color: #FF0000; font-family: Arial Narrow; font-weight: bold">
<option>Please select...</option>
<option>Wilson</option>
<option>Slazenger</option>
<option>Donnay</option>
<option>Head</option>
<option>Dunlop</option>
<option>Prince</option>
<option>Other</option>
<option>N/A</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>What brand of
tennis balls do you use most often? (If you don't play tennis, please
select N/A)</b></font></td>
<td width="60%"><font face="Arial Narrow" color="#FF0000"><b><select size="1" name="Question5" style="font-family: Arial Narrow; color: #FF0000; font-weight: bold">
<option>Please select...</option>
<option>Wilson</option>
<option>Slazenger</option>
<option>Donnay</option>
<option>Head</option>
<option>Dunlop</option>
<option>Prince</option>
<option>Other</option>
<option>N/A</option>
</select></b></font></td>
</tr>
<tr>
<td width="40%"><font face="Arial Narrow" color="#FF0000"><b>Finally,
what's your email?</b></font></td>
<td width="60%"><input type="text" name="T3" size="37" style="font-family: Comic Sans MS; color: #0000FF; font-weight: bold"></td>
</tr>
</table>
<p align="center">
<input type="submit" name="submit" value="Submit Form and Rate Me">
</font></p>
</form>

Sweeper Steve
03-13-2005, 05:33 PM
Ok, i've signed up (i think)

<input type="hidden" name="allforms" value="
---------------
Form Name:
Form ID : 102493
---------------
YcZjNmQ1NGIxN2I3OWEzMGRlZDFmOWJiZGU2YjYwODcxZMZiaWpoamzU0KStnaqWp6SZlpytqJ2e
qnSZqKyhkqKkYpSopdDN1dTQzdXU0M3V1NDNZMRkvWk=
---------------
">


It's given me that, is that the link?




EDIT: it also said this: <form action="http://free.mailjol.net/allforms.php" method="POST">

TheBigT
03-13-2005, 07:50 PM
http://free.mailjol.net/allforms.php

That is the link and then that other just has to go right under the <form> tag

Sweeper Steve
03-13-2005, 09:06 PM
:D Works perfectly!

Thanks a lot :)


When the user clicks "submit" they get redirected to the site saying "everything went fine, form sent"

how can you change that website to something else but still get the form sent?

That's my final question, honest! :p


Thanks,
Steve

TheBigT
03-13-2005, 11:08 PM
If you go to that site I gave you there is an option at the bottom of the page to do that. If not then add this to the submit button and I believe it should work.

Here is a small script. here is a warning that it might not work since you are using the form site I gave you.

Add this to your head tag:


<script>
<!--
function redirect(){
top.location.replace("http://cnn.com");
}
//-->
</script>

And add this to your form tag.


onsubmit="redirect()"

Sweeper Steve
03-14-2005, 03:44 PM
Got it :D


Thanks a lot :)


I've got the form on www.tennisrating.xs3.com, and now i just need to create a "rating page" :)


I may require help on using the data entered redirecting to a certain website, like if they tick one box on the questionnaire, then they go to a certain site, if they tick the other, they go to a different one etc etc ;)

TheBigT
03-14-2005, 11:25 PM
I can do that also. Like when the tick it another window opens. As for ratings page I sincerely don't know how to do one of those lol. Sorry I guess someone else that has more knowledge can do one. Plus I think it requires PHP or some other serverside scripting so that it saves the ratings.

Sweeper Steve
03-15-2005, 07:45 PM
I don't mean like a proper rating :p

I just mean, if they select "I play tennis over 10 hours a week" then i will redirect them to a site i've made saying "Wow, you really seem to know your stuff about tennis!"

But if they select "I don't play tennis" then they get redirected to a site saying "It doesn't look like you're good enough to become a pro yet" etc etc.

TheBigT
03-15-2005, 10:17 PM
Yeah I think I know what you want.. I added you to MSN so we can continue our conversation on there.. I am going to be busy for today, tomorrow, and Saturday but the rest of the days are up in the air because of my schedule... I will probably get to you Thursday at the latest... so Message me on MSN if you see me... my names Tony.

Sweeper Steve
03-16-2005, 06:21 PM
Ok....meet you on :p

Sweeper Steve
03-20-2005, 11:36 AM
Hi again...since i havent seen you online...how about explaining to me in the topic??

Thanks,
Steve