隐藏功能隐藏的联系表单

时间:2014-01-05 11:05:34

标签: javascript jquery html contact-form

联系表单发送,没问题.javascript代码; hide()中的sucess函数无法正常工作。我想隐藏html div id =“contactform”

有什么问题?在div中联系表格html隐藏为什么不工作?

HTML CODE

 <!--sending after div hide not working?-->  
 <div id="contactform"> 
                          <form id="contact" action="">
                            <fieldset>
                                <label for="name" id="name_label">NAME</label>
                                <input type="text" name="name" id="name" size="50" value="" class="text-input" >
                                <span class="error" id="name_error">PLEASE NAME</span>
                                <label for="email" id="email_label">EMAIL</label>
                                <input type="text" name="email" id="email" size="50" value="" class="text-input" >
                                <span class="error" id="email_error">PLEASE EMAIL</span>
                                <span class="error" id="email_error2">EMAIL ERROR</span>
                                <label for="phone" id="phone_label">TELEPHONE</label>
                                <input type="text" name="phone" id="phone"  value="" class="text-input" >
                                <label for="msg" id="msg_label">MESSAGE TEXT</label>
                                <textarea cols="60" rows="5" name="msg" id="msg" class="text-input"></textarea>
                                <span class="error" id="msg_error">PLEASE MESSAGE</span><br >
                                <input type="submit" name="submit" class="button" id="submit_btn" value="Gonder" >
                            </fieldset>
                          </form>
                          <div id="message"></div>
                        </div>                      

JavaScript代码

          jQuery.ajax({
          type: "POST",
          url: "aspmail.asp",
          data: dataString,
          success: function() {
          jQuery('#contactform').html("<div id='message'></div>");
            jQuery('#message').html("<strong>Message send</strong>")
      .append("<p>thank you</p>")
      .hide() // not working hide?
               .fadeIn(1500, function() {
              jQuery('');
            });
          }
         });
        return false;
        });
    });

1 个答案:

答案 0 :(得分:0)

尝试.css(“display”,“none”)而不是hide()

相关问题