JSFiddle - React, Tailwind, and code Playground
by somekittens
HTML
<form>
<label for="companyName">Company Name:</label><input type="text" id="companyName" /><br />
<label for="ceoName">CEO Full Name:</label><input type="text" id="ceoName" /><br />
<label for="phoneNumber">Phone Number:</label><input type="text" id="phoneNumber" /><br />
<label for="faxNumber">Fax Number:</label><input type="text" id="faxNumber" /><br />
<label for="streetAddress">Street Address:</label><input type="text" id="streetAddress" /><br />
<label for="city">City:</label><input type="text" id="city" /><br />
<label for="State">State:</label><input type="text" id="State" /><br />
<label for="zipcode">Zipcode:</label><input type="text" id="zipcode" /><br /><br />
<label for="yearEstablished">Year Established:</label><input type="text" id="yearEstablished" /><br />
<label for="ticketEmail">Ticket Support Email:</label><input type="text" id="ticketEmail" /><br />
<label for="website">Website URL:</label><input type="text" id="website" /><br />
<label for="brandname">MSP Brandname:</label><input type="text" id="brandname" /><br />
<label for="twitter">Twitter URL:</label><input type="text" id="twitter" /><br />
<label for="facebook">Facebook Page URL:</label><input type="text" id="facebook" /><br />
<label for="linkedIn">LinkedIn URL:</label><input type="text" id="linkedIn" /><br />
<input type="submit"/>
</form>
Results:
<div id="results"></div>
JavaScript
$("document").ready(function(){
$("form").on("submit", function(){
$.ajax({
type: 'POST',
url : "sendToCW.php",
data : $(this).serialize(),
success : function(data){
$("#results").html(data)
},
error : function(jqXHR, textStatus, errorThrown){
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
}
});
return false;
});
});