Posts

Showing posts from September, 2013

get an input field value from the last row in a table using jquery

$ ( 'table#table1 tr:last input[name=code]' ). val ();

count number of rows in a table using jquery

var rowCount = $ ( '#myTable tr' ). length ;

allow only numeric (0-9) in html inputbox using jquery

jsnya : <script type="text/javascript"> $(document).ready(function(){ //numeric numericOnly('biaya'); numericOnly('OutboundDetail_weight'); function numericOnly(id){ $("#"+id).keydown(function(event) { // Allow: backspace, delete, tab, escape, and enter if ( event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 || // Allow: Ctrl+A (event.keyCode == 65 && event.ctrlKey === true) || // Allow: home, end, left, right (event.keyCode >= 35 && event.keyCode <= 39)) { // let it happen, don't do anything return; } else { // Ensure that it is a number and stop the keypress if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < ...

resetting multi element/controll form using jquery

function resetForm($form) { $form.find('input:text, input:password, input:file, select, textarea').val(''); $form.find('input:radio, input:checkbox') .removeAttr('checked').removeAttr('selected'); } // to call, use: resetForm($('#myform')); // by id, recommended resetForm($('form[name=myName]')); // by name source : http://stackoverflow.com/questions/680241/resetting-a-multi-stage-form-with-jquery

close thickbox popup from code behind asp.net c#

ScriptManager .RegisterStartupScript( this , typeof ( Page ), UniqueID, “self.parent.tb_remove()” , true );

Reset Dropdownlist value using jQuery

$('#name').prop('selectedIndex',0);

Get selected text from dropdownlist using jQuery

$ ( "#yourdropdownid option:selected" ). text ();

cast or convert from varchar to integer in mysql

select convert(id, UNSIGNed integer) as id from tb_test order by id select CAST(id AS UNSIGNED) as id from tb_test order by id

get data from textbox on form pop up using thickbox

cara pertama dengan alt tag:   jsnya :   <script type="text/javascript">         function GetLinks(i,vsid) {           document.getElementById("btn"+i).alt = "packageBookingRes.aspx?vsid="+vsid+"&BPax=" + document.getElementById('txtBookingPax'+ i).value + "&keepThis=true&TB_iframe=true&height=450&width=605";         }     </script>   htmlnya :   <input type=\"button\" id=\"btn" + i.ToString() + "\" onclick='GetLinks(" + i.ToString() + ",\""+vsid+"\")' class=\"thickbox sendbook\" value=\"Booking\" />   ---------------------------------------------   cara kedua dengan tb_show :   jsnya :   <script type="text/javascript">     function GetPax(i, vsid) {       if((document.getElementByI...

change cjuidatepicker / jquery datepicker z-index

. date_field { position : relative ; z - index : 100 ;}   jQuery will set the calendar's z-index to 101 (one more than the corresponding element). The position field must be absolute , relative or fixed . jQuery searches for the first element's parent, which is absolute/relative/fixed, and takes its' z-index source : http://stackoverflow.com/questions/11533161/jquery-ui-datepicker-change-z-index
DESCRIBE tb_invoice; show create table tb_invoice; select * from `information_schema`.`tables`   where table_name like 'tb_invoice'