css按钮提交代码问题? [英] css button submit code problem?

查看:58
本文介绍了css按钮提交代码问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以通过它发送电子邮件的联系表格



 <  表格    id   =  contact-form    action   =  sendemail.php   方法  = 发布 >  
< fieldset >
< label > < span class = text-form<您的姓名:< > < 输入 type = text name = 名称 > < ; / label >
< label > < span class = text-form > 您的电子邮件:< / span > < 输入 类型 = text 名称 = 电子邮件 > < / label >
< div class = wrapper >
< div class = text-form > 您的消息:< / div >
< div < /跨度> class = extra-wrap >

< textarea 名称 = msg > < / textarea >
< div class = clear > ; < / div >
< div class = 按钮 >
< span class = button-2 >
< a onClick = document.getElementById('contact-form')。reset() > < strong > clear < / strong > < / a >
< / span >
< span class = button-3 >
< a > < 输入 id = 提交 类型 = submit 名称 = < span class =code-keyword>提交
> < strong > 发​​送< / strong < span class =code-keyword>>
< / a >

< / span >
< / div >
< / div >
< / div >
< / fieldset >
< / form >







此代码完美运行..我只需要为提交按钮做一些css调整





我的清晰按钮显示完美。



但提交按钮更大比清除按钮看起来很糟糕



我需要转换我的提交按钮和清除按钮一样





i有一个PHP代码,通过这个表单发送电子邮件



 <?php  

if(isset($ _ POST [' 提交'])){
$ email = $ _REQUEST [' email'];
$ msg = ' 名称:'。$ _ POST [' name']。 \ n
' 电子邮件:'。$ _ POST [' email']。 \ n
' 评论:'。$ _ POST [' comment'];

$ retval = mail(' ruvininanayakkara@jspark.co'' 反馈表格结果',$ msg, From:$ email);
if( $ retval == true)
{
echo < script type ='text / javascript'> alert('已成功提交!')< / script> ;
}
其他
{
echo < script type ='text / javascript'> alert('failed!')< / script>;
}
}
else {
exit(0);
}


?>







提交按钮我也有css代码





< pre lang =css>。 button-3 {
display inline-block;
padding-bottom < span class =code-keyword>: 5px;
background < span class =code-keyword>: url(../ images / button2-shadow.png)center bottom no-repeat;
cursor 指针;
}
button-3 a {
DIS播放 inline-block;
font-family Trebuchet MS,Arial,Helvetica,sans-serif;
font-size 16px;
line-height 2em ;
padding 4px 10px 4px 20px;
font-weight bold;
text-transform 大写;
颜色 #fff;
背景 url(../ images / button2-tail.gif)0 0 repeat-x# 010101;
border-radius 22px;
cursor 指针;
}
button-3 a strong {
display inline-block;
padding 0 50px 0 20px;
背景 url(../ images / marker-2 .png)右7px不重复;
}
button-3 a:悬停 {背景 #278e28 }





i已经将这些文件放到服务器上你可以检查一下并清楚地知道我在说什么



查看我的页面... http://jspark.co/contacts.html [ ^ ]



i不能更改按钮..因为我在我的网站上随处可见这个按钮样式?

i尝试了很多东西。



请给我一个解决方案....我希望有人能帮助我。



i可以完美地发送电子邮件我只需要更改此按钮与清除按钮

解决方案

_POST [' < span class =code-string> submit'])){


email =


_REQUEST [' email'];


i have a contact form which can send emails through it

<form id="contact-form" action="sendemail.php" method="post">
                                <fieldset>
                                      <label><span class="text-form">Your Name:</span><input type="text" name="name"></label>
                                      <label><span class="text-form">Your Email:</span><input type="text" name="email"></label>
                                      <div class="wrapper">
                                        <div class="text-form">Your Message:</div>
                                        <div class="extra-wrap">

                                            <textarea name="msg"></textarea>
                                            <div class="clear"></div>
                                            <div class="buttons">
                                                <span class="button-2">
                                                    <a onClick="document.getElementById('contact-form').reset()"><strong>clear</strong></a>
                                                </span>
                                                <span class="button-3">
                                                <a><input id="submit" type="submit" name="submit" ><strong>send</strong></a>

                                                </span>
                                            </div>
                                        </div>
                                      </div>
                                </fieldset>
                            </form>




this code works perfectly.. i only needed to do some css adjusments for submit button


my clear button shows perfectly.

but submit button bigger than the clear button and it looks awful

nw i needed to convert my submit button same as clear button


i have a php code which send email through this form

<?php

 if(isset($_POST['submit'])) {
  $email = $_REQUEST['email'] ;
     $msg = 'Name: ' .$_POST['name'] ."\n"
     .'Email: ' .$_POST['email'] ."\n"
     .'Comment: ' .$_POST['comment'];

     $retval =  mail( 'ruvininanayakkara@jspark.co','Feedback Form Results',$msg, "From: $email" );
    if( $retval == true )
   {
      echo "<script type='text/javascript'>alert('submitted successfully!')</script>";
   }
   else
   {
      echo "<script type='text/javascript'>alert('failed!')</script>";
   }
     }
else{
    exit(0);
    }


?>




for the submit button i have css code as well


.button-3 {
    display:inline-block;
    padding-bottom:5px;
    background:url(../images/button2-shadow.png) center bottom no-repeat;
    cursor:pointer;
}
    .button-3 a {
        display:inline-block;
        font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size:16px;
        line-height:2em;
        padding:4px 10px 4px 20px;
        font-weight:bold;
        text-transform:uppercase;
        color:#fff;
        background:url(../images/button2-tail.gif) 0 0 repeat-x #010101;
        border-radius:22px;
        cursor:pointer;
    }
        .button-3 a strong {
            display:inline-block;
            padding:0 50px 0 20px;
            background:url(../images/marker-2.png) right 7px no-repeat;
        }
    .button-3 a:hover {background:#278e28}



i already put this files to server you can check that and get a clear idea what i'm saying

check my page... http://jspark.co/contacts.html[^]

i cant change the button.. because i put this button style everywhere in my website?
i tried so many things.

please give me a solution.... i hope someone will help me on this.

i can send email perfectly i only need to change this button same as clear button

解决方案

_POST['submit'])) {


email =


_REQUEST['email'] ;


这篇关于css按钮提交代码问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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