admin
Filed under - Ajax, jQuery, PHP
1 Comment so far. Add yours now
Selec All Code:
 
 
 
* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
 
 
  $(document).ready(function(){
    $("#commentForm").validate();
  });
 
 
 
 
 
 <form method="get" action="">
 <fieldset>
   <legend>A simple comment form with submit validation and default messages</legend>
   <p>
     <label for="cname">Name</label>
     <em>*</em>
   </p>
   <p>
     <label for="cemail">E-Mail</label>
     <em>*</em>
   </p>
   <p>
     <label for="curl">URL</label>
     <em>  </em>
   </p>
   <p>
     <label for="ccomment">Your comment</label>
     <em>*</em><textarea name="comment" cols="22"></textarea>
   </p>
   <p>
 
   </p>
 </fieldset>
 </form>
Selec All Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
$.ajax({
           type: "POST",
           url: "/services/Mail.asmx/SendMail",
           cache: false,
           contentType: "application/json; charset=utf-8",
           data: "{ 'body':'"  + messageBody + "'," +
                     "'to': '" + msgTo + "'," +
                     "'from': '" + msgFrom + "'," +
                     "'subject': " + msgSubject + "'" +
                 "}",
           dataType: "json",
           complete: function (transport) {  if (transport.status == 200) $("#formcontainer").html("Success"); else alert("Please try again later"); }
       });

Regards,
Nimesh Parekh

One Response


  1. Abe Unglesbee on 14 Oct 2012

    I just want to say I am new to blogs and definitely liked you’re web site. Most likely I’m going to bookmark your site . You absolutely have great articles and reviews. Thanks for sharing with us your website.


Leave your comment

You must be logged in to post a comment.

Share IT © 2018. All rights reserved.