Ilya Moskovkin February 2016

How can I make a submit button change color and text when form succesfully submitted

my clients wants submit button turns green insted of orange when form succesfully submitted and change text on it. My form use php and its a bit to complex to me to make it work. Please someone help me with that intresting task.

Here is sample of page where you can see form and big orange button.
http://makeme3d.kz/time/time.html

And here is my code

HTML

    <div class="container form">
       <div class="row">
 <form form name="sentMessage" class="well" id="contactForm" novalidate >

 <h2 align="center">Get Free Quote Today and Start Saving</h2>
        <div class="col-md-6 left">

  <div class="control-group ">
    <label class="control-label">Full name</label>
    <div class="controls">
    <input type="text" class="form-control"  id="name" placeholder="Full name" 
            required  data-validation-required-message="Please enter your name" />
            <p class="help-block"></p>
 </div>
  </div>
  <div class="control-group">
<div class="controls">
    <label class="control-label">Business name</label>
    <input type="text" class="form-control" id="bname"  placeholder="Business name"
    required data-validation-required-message="Please enter your Business name" />
 </div>
  </div>
 </div>
<div class="col-md-6 right">
<div class="control-group">
<div class="controls">
    <label class="control-label">Email address</label>
    <input type="email" class="form-control" id="email"  placeholder="Email"
    required data-validation-required-message="Please enter your Email" />
    <p class="help-block"></p>
  </div>
 </div>
  <div class="control-group">
<div class="controls">
    <label class="control-label">Best contact pho        

Answers


Matthew Lymer February 2016

You have an ajax function being run.

Add the following JS into the success function:

$(".btn-custom").css("background-color","green");
$(".btn-custom").val("New Text");

Obviously change these as needed.

Post Status

Asked in February 2016
Viewed 1,170 times
Voted 6
Answered 1 times

Search




Leave an answer