感谢您提交表单时提醒 [英] Thank you alert upon form submission

查看:159
本文介绍了感谢您提交表单时提醒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 http://www.happyholidaylites.com/contact.html上有一个非常基本的表单并且它工作得很好。当您提交表单时,用户将被带到index.html,并且不会发送表单已发送的消息。我正在寻找一个警报,用x按钮表示您的表单已提交。我的代码如下所示:



 < form method = postid =myFormaction =dynaform.php> 

< input type ='hidden'name ='rec_mailto'value='JBIRD1111@gmail.com'>
< input type ='hidden'name ='rec_subject'value ='New Contact Form'>
< input type ='hidden'name ='rec_thanks'value ='index.html'>

等等......

最后一行是告诉表单在按下submit按钮后要做什么,但我不希望它将浏览器指向索引,而是我想要一个带有成功消息的JavaScript弹出窗口。任何想法?

解决方案

为什么不是简单的onSubmit?

 < form method =postid =myFormaction =dynaform.phponSubmit =alert('Thank you for your feedback。'); > 


I have a very basic form at http://www.happyholidaylites.com/contact.html and it is working great. When you submit the form, the user is brought to the index.html with no message that the form has been sent. I am looking to initiate an alert that says, "your form has been submitted" with an x button. My code looks like this:

      <form method="post" id="myForm" action="dynaform.php">

      <input type='hidden' name='rec_mailto' value='JBIRD1111@gmail.com'>
      <input type='hidden' name='rec_subject' value='New Contact Form'>
      <input type='hidden' name='rec_thanks' value='index.html'>

so on and so forth.....

The last line is what is telling the form what to do after the submit button is pressed, but I dont want it to point the browser to the index, rather I want a javascript popup with a success message. Any ideas?

解决方案

Why not a simple onSubmit?

<form method="post" id="myForm" action="dynaform.php" onSubmit="alert('Thank you for your feedback.');" >

这篇关于感谢您提交表单时提醒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆