grab our rss feed  Follow us on twitter

s2sgateway

Practical Learning of Programming languages such us j2ee,java,jsp

To Download Our Web-Application Free E-book Enter your Mail Address Below

Enter your E-mail Address to Subscribe Tutorials and Free Projects:

  Powered by FeedBurner

Entries for the ‘Javascript’ Category

Solving the c:\fakepath problem/upload problem easily

ShareThere is a situation when you want to get the string that is returned by the value attribute of a file upload input <input type=”file” name=”upload”/> under Internet Explorer 8?But the desired full path is not passing in the parameters only name of the file is passing,When you put a simple javascript ie onclick the [...]

Comments

Print a particular area of a page using javascript

ShareGuys today we are going to know how to print specific portion of a page using javascript.
See the example below first write the javascript in head section and cover the places you want to print with in div id=”print” and finally call the javascript within the page

function print1(strid)
{
if(confirm(”Do you want to print?”))
{
var values = document.getElementById(strid);
var [...]

Comments

linking two or more pages from radio button using javascript

ShareNow you are going to know how to get the value from radio button and open a new page when option is clicked.For example you have a form with two option boxes.

<form name=”redirect”>
<input type=”radio” name=”choose” onchange=”return call()”>yahoo</input>
<input type=”radio” name=”choose” onchange=”return call()”>google</input>
</form>
Now write the script in head section as follows
<script type=”text/javascript”>
function call()
{
for(var i=0;i<document.redirect.length;i++)
{
if(document.redirect.choose[i].checked)
{
role=document.redirect.choose[i].value;
}
}
if(role==”yahoo”)
{
window.open(’http://www.yahoo.com’,'_self’);
}
else
{
window.open(’http://www.google.com’,'_self’);
}
return true;
}
</script>

Try it and [...]

Comments

Display current time and date in your Jsp page

ShareHere we are going to know how to display current time and date using javascript in Jsp or Html pages.

<div class=”form”>
<span id=”my_clock”></span>
</div>
<script type=”text/javascript”>
function startclock()
{
var thetime=new Date();
var nhours=thetime.getHours();
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var nday=thetime.getDay();
[...]

Comments

how to check value is number or not using Javascript

ShareJava-script is a powerful technique to check certain condition on client-side itself before submitting form to check at server-side,so that time will be saved.
Here we are going to know how to check a value whether it is number or not and no’s not more than 6 using javascript.
For ex.You get the value from simple form.

<form [...]

Comments