Category : ajax

Hi i want to display number of items in the header. When add to cart button is clicked the number should increment. How do i do this using ajax? <body> <div> <a class="cart"><i class="fa fa-shopping-bag cart" style=’font-size:24px’></i> <span id="cartItems" class="badge badge-danger">0</span></a> <form class="form" action=""><input type="submit" name="addToCart" class="btn btn-info addbtn" value=" Add to cart"></form> </div> </body> ..

Read more

I’m working on a PHP project and need to do an ajax call however it’s set up in such a way that "ve never seen before. I have one file: index.php that looks like this: echo ‘<input id=ajax_redraw name=ajax_redraw type=button value="Redraw" onclick="ajaxTest()" />’; echo ‘<div id=destination_div name=destination_div class=ajax_test >’; echo ‘</div>’; echo end_page(); function redraw_destination_div() ..

Read more

I have a data table using which I send the data using a POST request, The below code also uses js which is not enclosed here. <tbody> <?php for($i=0;$i<6;$i++){ ?> <tr> <td></td> <?php if($i<3){echo "<td>sms</td>";}else{echo "<td>Email</td>";}?> <input type="hidden" name="rowcount[]" id="rowcount_<?=$i?>"value="<?=$i?>" disabled> <td scope=’row’> <?php if($i==0 || $i==3){ echo "<input type=’checkbox’ name=’Action[]’ value=’1′>Planned"; } else if($i==1 ..

Read more

I am using jQuery Validator for validations. However for number or digits only the validation not working. It is accepting special characters also. Instead of letters and special characters I want only digits. $.validator.addMethod("Length", function(value, element) { // var password_regex = this.optional(element) || /^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[@$!%*?&])[[email protected]$!%*?&]{6,}$/.test(value); if ($(element).val() != ” && $(element).val().length !== 20) { return false; ..

Read more