Check if Field is empty or Not in Javascript:: $(“#search-form”).on(‘submit’,function(){ var dis = $(this); searchbox = dis.find(“input[name=’product_name’]”).val(); var submitform = true; $(“#search-form-msg”).css(‘color’,’red’); if(searchbox.trim().length == 0){ …
Read MoreJavaScript
find input by name jquery in a form on submit in Javascript
find input by name jquery in a form on submit in Javascript:: $(“#search-form”).on(‘submit’,function(){ var dis = $(this); searchbox = dis.find(“input[name=’product_name’]”).val(); console.log(searchbox); return false; });
Read Moremake slug in javascript or jquery
** make slug in javascript or jquery:: <script type=”text/javascript”> //Make Slug:: function slugify(text) { return text.toString().toLowerCase() .replace(/\s+/g, ‘-‘) // Replace spaces …
Read MoreTwo submit buttons in one form
Two submit buttons in one form:: We can use more than one submit button in a single form. We can use more than one submit …
Read MoreSelect / Deselect all checkboxes using jQuery
Select / Deselect all checkboxes using jQuery: The HTML Structure is following type::The HTML Structure is following type:: <table> <tr> <td><input type=”checkbox” id=”checkbx_selectall” /> Select …
Read MoreJquery- Check if is valid price or not
Check the valid price in Jquery. If the price is valid or not.It returns TRUE or FALSE. function CheckValidPrice(price=0){ var tempPrice = Math.round(price * 100)/ …
Read MoreJquery- on Form Submit Validate
On Form Submit Validate using Jquery <script type=”text/javascript”> $(document).ready(function() { $(“#shr_form”).on(‘submit’, function() { var dForm = $(this); var damount = dForm.find(“input[name=damount]”).val(); var dMsgElmnt= dForm.find(“#dmessage”); dMsgElmnt.html(”); …
Read MoreCheck if input is valid number in Jquery or Javascript
It Returns TRUE or FAlSE. If Valid Number It Returns True , Otherwise False. <script> function CheckValidPrice(price=0){ var tempPrice = Math.round(price * 100)/ …
Read MoreRedirect with PHP after ajax call
Redirect with PHP after ajax call $(‘#button_name’).click(function() { var save_sale = 1; $.ajax({ type: ‘GET’, url: ‘page.php’, data: {save_sale: save_sale}, success: function(data) { window.location.href = …
Read MoreCreate A button with function in Jquery
#Create A button with function in Jquery var fav_del = ‘<i class=”fa fa-trash-o” aria-hidden=”true”></i>’; var fav_del = ‘<i class=”fa fa-trash-o” aria-hidden=”true”></i>’; var delete_btn = $(“<button/>”).attr({ …
Read More