Category Archives: Java Scripts

It contains Java Scripts that I learn newly.

How to set method of a html form using javascript or js?

It can be done as follows :

document.forms["Form_Name"].method= "get";
or
document.forms["Form_Name"].method= "post";

How to set action for a form using javascript or js?

It can be done as follows :

document.forms["Form_Name"].action = "file_name.ext";

It can be followed in any programming language. It’s tested and working. Tested by myself

How to implement “select all” check box using js in HTML?

It can be implemented as follows…

<input id="my_selectall" style="box-shadow: 0px 0px 0 0; width: auto;" onclick="mycheck()" type="checkbox" /> Sl No.
<input style="box-shadow: 0px 0px 0 0; width: auto;" type="checkbox" name="case" value="1" /> 1
<input style="box-shadow: 0px 0px 0 0; width: auto;" type="checkbox" name="case" value="2" /> 2
<input style="box-shadow: 0px 0px 0 0; width: auto;" type="checkbox" name="case" value="3" /> 3
<input style="box-shadow: 0px 0px 0 0; width: auto;" type="checkbox" name="case" value="4" /> 4
<script type="text/javascript">
    function mycheck() {
        var source=document.getElementById('my_selectall');
        checkboxes = document.getElementsByName('case');
        for(var i=0, n=checkboxes.length;i<n;i++) {
            checkboxes[i].checked = source.checked;
        }
    }
</script>

Zooming image with jquery

Check the following links to see how it work

To download it please click the below links

Jquery in PHP & Perl…

When we try to print “jquery” inside “PHP or Perl” using “echo or print” statement we should escape the$” symbol used in the jquery. It should be as follows.

print qq{

<script type=”text/javascript”>
(function(\$) {
\$(function() {
\$(“#scroller”).simplyScroll({orientation:’vertical’,customClass:’vert’});
});
})
(jQuery);
(function(\$) {
\$(function() {
\$(“#scroller1”).simplyScroll({direction:’backwards’});
});
})(jQuery);
(function(\$) {
\$(function() {
\$(“#scroller2”).simplyScroll({direction:’backwards’});
});
})(jQuery);
</script>

}

echo ‘

<script type=”text/javascript”>
(function(\$) {
\$(function() {
\$(“#scroller”).simplyScroll({orientation:’vertical’,customClass:’vert’});
});
})
(jQuery);
(function(\$) {
\$(function() {
\$(“#scroller1”).simplyScroll({direction:’backwards’});
});
})(jQuery);
(function(\$) {
\$(function() {
\$(“#scroller2”).simplyScroll({direction:’backwards’});
});
})(jQuery);
</script>

‘;