?
Solved

I want a pop-up window to appear after clicking 'submit' (which sends the textbox info to my e-mail)

Posted on 2003-03-12
11
Medium Priority
?
177 Views
Last Modified: 2010-04-06
here is my code:

<FORM METHOD="POST" ACTION="mailto:(my e-mail address)">
<INPUT TYPE="text" NAME="e-mail_address" SIZE="30">
<INPUT TYPE="submit" value = "Submit">
</FORM>

So when they click the submit button, it e-mails me whatever address they typed into the given textbox.

I want a pop-up window to appear saying 'Thank you, your address has been submitted'.  
How do i do that?

PLEASE HELP!  I need this A.S.A.P!  Any help is appreciated!
0
Comment
Question by:slipknotish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
11 Comments
 
LVL 17

Expert Comment

by:dorward
ID: 8122630
First using "mailto:" is _highly_ unreliable.

* http://www.isolani.co.uk/newbie/mailto.html

If you do use mailto, then you can't have a popup window appear after the data has been sent. You could have one popup before the data is sent:

<form ... onsubmit="window.open('mypage.html');">

However, as mailto: is so very unreliable there is a very good chance that "You address has been submitted" would be a lie.

If you switch to a proper formailer:

* http://www.allmyfaqs.com/faq.pl?Email_form_data

Then you can display a page containing whatever content you like (unless you use a third party hosted formailer which limits your options) on the page that appears while the form data is processed. You could put a window.open in the onload event of that page, but lots of people run spam blockers which would consider that to be an advert and block it.
0
 
LVL 1

Accepted Solution

by:
cwvsmart earned 200 total points
ID: 8124895
<HTML>

<BODY>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function GO(a)
{
a.submit()

alert("Thank you, your address has been submitted")
}
-->
</SCRIPT>

<FORM METHOD="POST" ACTION=":(my e-mail address)">

<INPUT TYPE="text" NAME="e-mail_address" SIZE="30">

<INPUT TYPE="button" value="GO" onClick=GO(this.form)>

</FORM>

</BODY>
</HTML>

I hope this helps. But do bear in mind that what dorward says is true. If you have any other questions or need to verify certain fields, feel free to post a comment as we can do a lot more. All the best.
0
 

Author Comment

by:slipknotish
ID: 8125988
cwvsmart, thank you so much!

<FORM METHOD="POST" ACTION=":(my e-mail address)">
-before the :, do i put mailto?

so a little window will appear with that?  or will it be a message box?

sorry, i'm still learning a bit.
0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

Author Comment

by:slipknotish
ID: 8125992
by the way, thank you dorward!  i learned a lot from reading those!  

i'm determined to learn how to use CGI and all that stuff..
0
 

Author Comment

by:slipknotish
ID: 8126004
ok i just tested it out, and found out the answers to both my questions...

thanks you very much guys!
0
 

Author Comment

by:slipknotish
ID: 8126009
The code worked perfectly!  I am very greatful, as this is almost exactly what i was looking for!
0
 
LVL 1

Expert Comment

by:cwvsmart
ID: 8133257
slipknotish...sorry for the late reply....It was a typo error...suppose to be <FORM METHOD="POST" ACTION="mailto:(my e-mail address)">...

Anyway, whether you want a msg box or little window to pop up...can be done easily.....all you have to do is change alert("Thank you, your address has been submitted") to this line  
window.open("tq.htm","ThanQ","width=400,height=400,top=50,left=200,scrollbars=1")

and create another html file called tq.htm like this
<HTML>

<BODY>
Thank you, your address has been submitted

</BODY>
</HTML>

this should do the trick. Just in case you're wondering what is window.open and things like that, you can go to this URL for references.
http://www.w3schools.com/js/js_window.asp
At the same time, you can pick up a thing or two.
0
 

Author Comment

by:slipknotish
ID: 8133841
cwvsmart, the code to open the window didn't work... i don't know why.

i tried changing it up, but it still didn't work...

what do i do?
0
 
LVL 1

Expert Comment

by:cwvsmart
ID: 8134513
slipknotish..don't mind if you post your codes here and me have a look so that we all can share our views....
0
 

Author Comment

by:slipknotish
ID: 8134660
<html>
<head>    
<title>Contact</title>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function GO(a)
{
a.submit()
alert("Thank you, your address has been submitted")
a.reset();
}
-->
</SCRIPT>

<script language="JavaScript">
<!--
function showStatus(msg) {
    window.status = msg
    return true
}
//-->
</script>

</head>
<body background = "white" LINK="000000" ALINK = "000000" VLINK="000000">
<center>

<p>
E-mail me at <a href="mailto:me@hotmail.com"onMouseOver="return showStatus('me')" onMouseOut="return showStatus('Done')">me@hotmail.com</a>
</p>

<p>Join the mailing list by entering your e-mail address below.<br>
<Form Method="POST" Action="mailto:me@hotmail.com">
<Input Type="text" Name="e-mail_address" SIZE="30">
<Input Type="button" value="Submit" onClick=GO(this.form)>
</Form>

*To be removed from the mailing list, please e-mail me at <a href="mailto:me@hotmail.com?subject=Unsubscribe"onMouseOver="return showStatus('me')" onMouseOut="return showStatus('Done')">me@hotmail.com</a> with the word 'Unsubscribe' as the subject and the e-mail address to be removed in the message.
</center>
</body>
</html>

there's my code... i can get the message box that you gave me the code for to popup when they submit their address in the form, but the popup window doesn't work for some odd reason...

also, do you know how to have the pop-up window or message box display the address that they entered?

i appreciate all the help you have give me thus far.
thank you very much, cwvsmart.
0
 
LVL 1

Expert Comment

by:cwvsmart
ID: 8134962
Ok. slipknotish. There are two things here. First, Your pop up window issue. You need to create another file called tq.htm
===========================================================
tq.htm
<HTML>
<BODY>
Thank you, your address has been submitted
</BODY>
</HTML>
===========================================================
and your own html file which I change the alert line with window.open
<html>
<head>    
<title>Contact</title>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function GO(a)
{
a.submit()
window.open("tq.htm","ThanQ","width=400,height=400,top=50,left=200,scrollbars=1")
a.reset();
}
-->
</SCRIPT>

<script language="JavaScript">
<!--
function showStatus(msg) {
   window.status = msg
   return true
}
//-->
</script>

</head>
<body background = "white" LINK="000000" ALINK = "000000" VLINK="000000">
<center>

<p>
E-mail me at <a href="mailto:me@hotmail.com"onMouseOver="return showStatus('me')" onMouseOut="return showStatus('Done')">me@hotmail.com</a>
</p>

<p>Join the mailing list by entering your e-mail address below.<br>
<Form Method="POST" Action="mailto:me@hotmail.com">
<Input Type="text" Name="e-mail_address" SIZE="30">
<Input Type="button" value="Submit" onClick=GO(this.form)>
</Form>

*To be removed from the mailing list, please e-mail me at <a href="mailto:me@hotmail.com?subject=Unsubscribe"onMouseOver="return showStatus('me')" onMouseOut="return showStatus('Done')">me@hotmail.com</a> with the word 'Unsubscribe' as the subject and the e-mail address to be removed in the message.
</center>
</body>
</html>
This should do the trick. Just a reminder. You should have two separate html files and save in the same folder.
===========================================================
Second issue regarding the other question. Correct me if I'm wrong. You're trying to display a pop up window/msg box with user's input right after they click submit, am i correct? Well, for now unless you know about ASP then it would be simpler but don't worry here i'll attach another copy using javascript. You try and see whether it suits you  
 
<html>
<head>    
<title>Contact</title>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function GO(a)
{
a.submit()
x=a.email_address.value
alert("Thank you, your address:" + "(" + x + ")" + "has been submitted")
a.reset();
}
-->
</SCRIPT>

<script language="JavaScript">
<!--
function showStatus(msg) {
   window.status = msg
   return true
}
//-->
</script>

</head>
<body background = "white" LINK="000000" ALINK = "000000" VLINK="000000">
<center>

<p>
E-mail me at <a href="mailto:me@hotmail.com"onMouseOver="return showStatus('me')" onMouseOut="return showStatus('Done')">me@hotmail.com</a>
</p>

<p>Join the mailing list by entering your e-mail address below.<br>
<Form Method="POST" Action="mailto:me@hotmail.com">
<Input Type="text" Name="email_address" SIZE="30">
<Input Type="button" value="Submit" onClick=GO(this.form)>
</Form>

*To be removed from the mailing list, please e-mail me at <a href="mailto:me@hotmail.com?subject=Unsubscribe"onMouseOver="return showStatus('me')" onMouseOut="return showStatus('Done')">me@hotmail.com</a> with the word 'Unsubscribe' as the subject and the e-mail address to be removed in the message.
</center>
</body>
</html>

If you are doing programming try not to name your variables like - or space. It's not a good practice.Therefore i changed your e-mail_address to email_address. If you're still have doubts do not hesitate to post your comments here.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question