Category: Jquery

Ajax File Upload without iframe

Naveen Nayak February 10, 2015 No Comments Jquery, LAMP, Web Development

The Invisible I-frame File Upload method works in almost all browsers. This post explains using FormData to submit forms that is supported by most new browsers. <? if( isset($_POST) && ! empty($_POST) ) { $file = $_FILES[‘myfile’]; $output =”Response From the Server\n”; $output .= “myInput = “.$_POST[‘myInput’]; $output .= “\n”.’File Name: ‘.$file[‘name’]; $output .= “\n”.’File […]

jQuery select lists

Naveen Nayak November 7, 2011 No Comments Jquery

Get the value of the selected item  $(“listBoxSelector :selected”).val(); Get the text of the selected item  $(“listBoxSelector :selected”).text(); Get multiple selected values ( or loop through all selected values ) $(“listBoxSelector :selected”).each(function(i, selected){      var value = $(selected).val();      var text = $(selected).text(); }); Empty a list  $(“listBoxSelector”).empty(); Append Options to a list  […]

Jquery Tips

Naveen Nayak November 3, 2010 No Comments Jquery

Contains common Jquery code Display jQuery version alert(jQuery.fn.jquery); Find how many check boxes have been checked var count = $(‘input[type=checkbox]:checked’).length; Get ID, class of an element var element_id = $(this).attr(‘id’);   or element_id =; var class = $(this).attr(‘class’);   or class = this.class; Set the attribute of an element $(this).attr(‘class’, ‘new-class’); $(this).attr(‘title’, ‘new-title’); Set […]

Page 1 of 1