## Used To Validate Email In Javascript <script > function validateEmail(email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; return emailReg.test( email ); …
Read MoreJavaScript
On select redirect to selected option
## On Select Option Redirect to Another Page $(“#getcity_understate”).on(‘click’, function(){ var s = $(“#under_state_id”).val(); window.location.href = “manage_city_list.php?ustate_id=”+s; });
Read MoreScroll to top
## scroll to top:: <style type=”text/css”> #plz-ridemeto-top{position:fixed;bottom:20px;right:10px;cursor:pointer;display:none;} </style> <script> $(‘body’).append(‘<div id=”plz-ridemeto-top” class=”btn btn-info”><span class=”glyphicon glyphicon-chevron-up”></span></div>’); $(window).scroll(function () { if ($(this).scrollTop() != 0) { $(‘#plz-ridemeto-top’).fadeIn(); console.log(“scrolled”); …
Read MoreForm validation using jQuery in php
## form validation in JQuery <script type=”text/javascript”> $(document).ready(function(){ $(‘#send_enquiry’).click(function(){ var get_validate = validateForm(); console.log(get_validate); if(get_validate>0){ return false; }else{ return …
Read MoreReset a form using jquery
## Reset a form using jQuery. <script> $(“#formid”).find(“input,textarea”).val(“”); </script>
Read MorejQuery click not working after append div
#Jquery: Click event doesn’t work after append. $(document).on(‘click’, ‘.’, function(e) //do whatever });
Read MoreOn click div change it child css in jquery
## On click “.xc-category” , Finds <div class=”catbox”> in “.xc-category” and changing the background-color <script> $(“.xc-category”).click(function(){ var dis = this; $(“#Step1″).find(‘div.catbox’).css(‘background-color’,”); $(dis).find(‘div.catbox’).css(‘background-color’,’#C3E7FF’); }); </script>
Read MoreCk editor options
Description: <textarea cols=”80″ id=”editor_ckxhr” name=”description” placeholder=”Enter Description” id=”description” rows=”5″></textarea> <script type=”text/javascript”> CKEDITOR.replace(‘editor_ckxhr’, …
Read MoreClose current window and Reload parent window
Close current window and Reload parent window:: <script type=”text/javascript”> window.close(); window.opener.location.reload(); </script> This script works only if the new window is opened …
Read MoreCLOSE POP UP WINDOW & RELOAD PARENT WINDOW
<script type=”text/javascript”> window.close(); window.opener.location.reload(); </script>
Read More