Friday, 16 December 2011

Jquery print option

<script type="text/javascript" src="jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="jquery.jqprint.js"></script>
<script type="text/javascript">
    function print_it(){
        if($("#including").is(':checked')) // check the box.
        {
            $("#divToPrintAll").jqprint(); // div to be print
        }
        else{
            $("#divToPrint").jqprint(); // div to be print
        }
    }

function removeChar(item)
{
    var val = item.value;
    //alert(val)
      val = val.replace(/[^0-9]/g, ""); 
      if (val == ' '){val = ''};  
      item.value=val;
}
</script>

<input name="including" id="including" type="checkbox" value="ya" /> Print All/ Print
<div id="divToPrintAll">
            <div id="divToPrint">
<input type="" onkeyup="removeChar(this)" >
content
</div>
</div>

No comments:

Post a Comment

Source base installation of php, mysql and apache in ubuntu/ linux

Compile and Install a LAMP(Linux/Apache/MySQL/PHP) Server from Source In the last post, I described the method to install a LAMP ser...