# Alternative Control Structure (if-else, while, foreach etc) <table> <? while ($record = mysql_fetch_assoc($rs)): ?> <? if (!$record[‘deleted’]): ?> …
Read MoreJQuery
make 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 MoreFacebook login script
<script> window.fbAsyncInit = function() { FB.init({ appId : ‘{your-app-id}’, cookie : true, xfbml : true, version : ‘{latest-api-version}’ }); FB.AppEvents.logPageView(); }; (function(d, s, id){ var …
Read More