Latest news
Home » Tag Archives: jQuery

Tag Archives: jQuery

How to download or print a page using PHP and javascript

jQuery(‘.payment-print’).live(‘click’, function() { var sUrl = jQuery(‘#base-url’).val() + ‘/jobs/paymentprint/id/’ + jQuery(this ).attr(“id”);, function(data){ var HTML = data; var WindowObject =” “, “PrintWindow”, “width=769,height=601,top=40,left=40,toolbars=no”); WindowObject.document.writeln(HTML); WindowObject.document.close(); WindowObject.focus(); WindowObject.print(); WindowObject.close(); }) });

Read More »

jQuery Validation of login by pressing enter key

Validate login by pressing enter key $(“#username, #password”).keydown(function(event) { // track enter key var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); if  ( keycode  == 13) {   // key code for enter key // force the keyboard  ‘Enter Key’ to implicitly click the Update button validateLogin(); return false; } else  { return true; } }); ...

Read More »

How to write a jQuery function

jQuery function jQuery is a type of  JavaScript programming script used in website development. jQuery is very strict in its syntax .Programmers are writing jQuery functions for doing specific tasks. Syntax of JQuery  function is //start <script type=”text/javascript”> $(“#username”).keydown(function(event) { }); </script> //end function This is a keydown function

Read More »

How to loop through array in jquery

if(jQuery.trim(jQuery(“#custom-email-input”).val()) != ”) { var sCustomemails = jQuery(“#custom-email-input”).val().split(‘,’); jQuery.each(sCustomemails, function(index, email) { if(!validEmail(email)) { jQuery(“#custom-email-input”).addClass(‘error’); alert(‘Please enter only valid email addresses.’); jQuery(“#custom-email-input”).attr(‘placeholder’,’Please enter only valid email addresses’); error=true; } else { jQuery(“#id_subject”).removeClass(‘error’); } }); }

Read More »