我是编程的新手,我正在制作我的第一个网站,好吧让我们明白一点。 以下是我为symple联系表单的实际HTML代码
<form class="row form" id="contacto" name="contacto" method="post" action="enviar.php">
<h3>Formulario de Contacto</h3>
<div class="col-sm-4 col-xs-12 form-group">
<label class="sr-only" for="nombre">Name</label>
<input name="nombre" class="form-control" type="text" placeholder="Nombre" id="nombre">
</div> <!-- /.form-group -->
<div class="col-sm-4 col-xs-12 form-group">
<label class="sr-only" for="email">Email</label>
<input name="email" class="form-control" type="email" placeholder="Email" id="email">
</div> <!-- /.form-group -->
<div class="col-sm-4 col-xs-12 form-group">
<label class="sr-only" for="telefono">telefono</label>
<input name="telefono" class="form-control" type="text" placeholder="Telefono" id="telefono">
</div> <!-- /.form-group -->
<div class="col-sm-4 col-xs-12 form-group">
<label class="sr-only" for="ciudad">ciudad</label>
<input name="ciudad" class="form-control" type="text" placeholder="Ciudad" id"ciudad">
</div>
</div>
</form> <!-- /.row -->
</div> <!-- /.container -->
</section> <!-- /.contact -->
答案 0 :(得分:-1)
这是解决方案:在提交类型的表单标记内添加一个按钮,其中定义了onclick:
<input type="submit" value="submit" onclick="return doit();" />
<script type="text/javascript">
function doit() {
alert("your message has been sent!");
return true;
}
</script>
答案 1 :(得分:-1)
<input type="submit" value="submit" onclick="alert('your message has been sent');" />