How to fix Double click button?
Hi guys,
I have this button below, the problem is I need to double click it before the form will submit.
- <?php
- if($data_completion != FALSE) { //If lesson already taken, disable submit button.
- ?>
- <input type="image" name="submitlesson" alt="Submit Lesson" src="<?php echo base_url('images/buttoncomplete1.jpg'); ?>" onmouseover="this.src='<?php echo base_url('images/buttoncomplete2.jpg'); ?>'" onmouseout="this.src='<?php echo base_url('images/buttoncomplete1.jpg'); ?>'" value="submit" disabled>
- <?php
- } else {
- //If lesson not yet taken, enable submit button.
- //Decide weather essay or multiple choice button.
-
- //Essay button
- if($data_lesson['essay'] == 'true') {
- ?>
- <input type="image" id="buttonessay" name="submitlesson" alt="Submit Lesson" src="<?php echo base_url('images/buttoncomplete1.jpg'); ?>" onmouseover="this.src='<?php echo base_url('images/buttoncomplete2.jpg'); ?>'" onmouseout="this.src='<?php echo base_url('images/buttoncomplete1.jpg'); ?>'" value="submit">
- <div id="btn"></div>
-
- <?php
- }
- //Multiple choice button
- if($data_lesson['essay'] == 'false') {
- ?>
- <input type="image" id="buttonmc" name="submitlesson" alt="Submit Lesson" src="<?php echo base_url('images/buttoncomplete1.jpg'); ?>" onmouseover="this.src='<?php echo base_url('images/buttoncomplete2.jpg'); ?>'" onmouseout="this.src='<?php echo base_url('images/buttoncomplete1.jpg'); ?>'" value="submit">
- <div id="btn"></div>
-
- <?php
- }
- }
- ?>
As you can see I have three buttons base from the above codes.
The double click happens on the id="buttonessay" button.
Below are the jQuery Codes.
What is causing the double click?
Thanks in advance whoever will help me.