Monday, March 29, 2010

Customize Javascript Confirm Box

Main.html
<html>
<head>
<title>
Customized Javascript Confirm Box Example
</title>
<script type="text/javascript">
function doDelete()
{
var returnVal=0;
if(window.showModalDialog)
{
returnVal=window.showModalDialog("YesOrNo.html","name","dialogWidth:455px;dialogHeight:140px");
}
if(returnVal==1)
{
alert("Deletion Succesfully Done");
// write your own functionality here
}
else
{
        alert("Deletion Cancelled");
// write your own functionality here
}
}
</script>
<body>
<font size="5">
<pre>
By clicking the bellow button you can observe customized javascript confirm dialog box
for deleting or some functionality what you require in your application.
                              

                                 <input type="button" value="Delete" onclick="doDelete();" style="font:20px"/>
</font>
</pre>

YesOrNo.html
<html>
<script>
function yesDelete(){
window.returnValue = 1; 
window.close();
return false;
}
function noDelete() {
window.returnValue = 0;  
window.close();
return false;
}
</script>
<body>
<div style="position:relative;left:0px;top:0px;background:#000066;color:#FFFFFF;font-size:20px;font-weight:bold;width:396px;height:25px;padding-left:38px;border-bottom:solid 2px #000000;">Confirm Delete...</div>
<blockquote style="font-size:18px;font-weight:bold;color:#FF0000;margin-top:50px;">Are you sure you wish to Delete this Record?</blockquote>
<div style="width:396px;text-align:center;">
<input type="button" value="    YES    " onclick="yesDelete();"  style="font-weight:bold;margin-right:10px;cursor:pointer;"><input type="button" value="     NO     " style="font-weight:bold;margin-left:10px;cursor:pointer;" onclick="noDelete();">
</div>
</body>
</html>

Both Main.html and YesOrNo.html files should be in the same folder.

Monday, March 22, 2010

GITAMAKARANDAM SPEECHES MP3(SWAMI VIDYAPRAKASHANANDAGIRI)


http://www.4shared.com/file/159142437/38732cb6/01_ARJUNA_VISHADA_YOGAM.html
http://www.4shared.com/file/157509026/b8499d37/02__SANKYA_YOGAM.html
http://www.4shared.com/file/157542710/5dc95c85/03_KARMA_YOGAM.html
http://www.4shared.com/file/157556837/48c5527e/04_GNANA_YOGAM.html
http://www.4shared.com/file/157575439/ce127a93/05_KARMA_SANYASA_YOGAM.html
http://www.4shared.com/file/157588456/78cd8f88/06_ATMA_SAMYAMA_YOGAM.html
http://www.4shared.com/file/157609092/da44f24b/07_VIGNANA_YOGAM.html
http://www.4shared.com/file/158651314/2a4b459/08__AKSHARA_PARA_BRAMHA_YOGAM.html
http://www.4shared.com/file/158677985/f65db6ec/09_RAJA_VIDYA_RAJA_GUHYA_YOGAM.html
http://www.4shared.com/file/158687171/faeba853/10_VIBHUTI_YOGAM.html
http://www.4shared.com/file/158699893/580881fd/11_VISWA_ROOPA_SANDARSHANAM.html
http://www.4shared.com/file/158710651/96095539/12_BHAKTHI_YOGAM.html
http://www.4shared.com/file/158734728/54f4d55a/13_KSETRA_KSHETRA_VIBHAGA_YOGA.html
http://www.4shared.com/file/158755411/33bf12a1/14_GUNATRAYA_VIBHAGAM.html
http://www.4shared.com/file/158768950/9dc6d66d/15_PURUSHOTTAMA_PRAPTI_YOGAM.html
http://www.4shared.com/file/158781895/82e3f632/16_DAIVASURA_SAMPTH_VIBHAGA_YO.html
http://www.4shared.com/file/159050116/27bc8ed7/17_SHABDAHATRAYA_VIBHAGA_YOGAM.html
http://www.4shared.com/file/159118189/9da97585/18_MOKSHA_SANYASA_YOGAM.html

Source : http://telugudevotionalswaranjali.blogspot.com/2009/11/gitamakarandam-speeches-mp3swami.html

Wednesday, March 17, 2010

Basic Servlet Structure

A servlet is a small Java program that runs within a Web server.Servlets receive and respond to requests from Web clients,usually across HTTP, the HyperText Transfer Protocol.

To write a Servlet Class we follow some basic steps.
1.Implement the Servlet interface available in javax.servlet package(javax.servlet.Servlet).
2.The acees speifier for your servlet class must be public.

Syntax:
 public class BasicServlet implements Servlet
 {
                   // Here we have to implement all methods in Servlet inteface.

  }

Methods in Servlet Inteface:

public void init(ServletConfig config) throws ServletException
{

}

By seeing the above method,we easily understand the init(ServletConfig config) always throws ServletException.So we have to handle when we implement our own Servlet class.

An Example to Implement init(ServletConfig config) method with some different syntax
Ex 1:
import javax.servlet.*;
public class SampleServlet implements Servlet
{
       public void init(ServletConfig config)
       {
                  try
                 {
                         //your code

                  }
                  catch(ServletException se)  { se.printStackTrace(); }
        }

// implement remaining all methods availabe in Servelt interface with some code to properly compile the java file
}

Ex 2:
import javax.servlet.*;
public class SampleServlet implements Servlet

{
       public void init(ServletConfig config) throws ServletException
       {

                    // your code
       }
// implement remaining all methods availabe in Servelt interface with some code to properly compile the java file

}

By seeing the above two examples,it is clear that when ever we write init(ServletConfig config) method ,it is not necessary to declare throws ServletException for inti(ServletConfig config) method.
    For informing the ServeltContainer to say initilization failed we are throwing ServletException to not to put  Servelt Object in service,instead of explicity handling ServletException using try/catch blocks.If we are handling exception explicity how to inform the container about init() fail.Is there any solution in this case.Think your self.

Monday, March 15, 2010

Software Jobs

visit the following links to know about the software jobs
1   http://www.javaken.com/
2.  http://www.presentjobs.com/
3.  http://www.jobconsultancy.com/

Disable Mouse Right Click in IE ,Firefox & Google Chrome

<script type="text/javascript">
<!-- Disable Right Click in IE & Firefox -->
var message="";


function clickIE()

{if (document.all)
{(message);return false;}}

function clickNS(e) {
if
(document.layers||(document.getElementById&&!document.all))
{
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.  onmousedown=clickNS;}
else
{document.onmouseup=clickNS;document.oncontextmenu  =clickIE;}

document.oncontextmenu=new Function("return false")
</script>

Sunday, March 7, 2010

javascript email validation example

This is the customized javascript email validation , based upon your requirement,you can be able to customize the validation with simple code.

function ValEmailId(arg)
{
    var email=arg;     
    var f=0;
      if (! allValidChars(email)) { 
    f=1;
      }    
      else if (email.indexOf(".") < 1)  { 
       f=1;
      }
      else if (email.indexOf("_") < 1 && email.indexOf("_")!=-1) { 
       f=1;              
      }
      else if (email.indexOf("-") < 1 && email.indexOf("-")!=-1) {
       f=1;
      }
      else if (email.indexOf("@") < 1) {
       f=1;
      }
      else if (email.indexOf(".@")>=0 || email.indexOf("_@")>=0 || email.indexOf("-@")>=0 ||  email.indexOf("@@")>=0 || email.indexOf("--")>=0 || email.indexOf("__")>=0 || email.indexOf("-_")>=0 || email.indexOf("_-")>=0) {
           f=1;
       }
      else if(email.indexOf("@.")>=0 || email.indexOf("@_")>=0 || email.indexOf("@-")>=0)
      {
          f=1;
      }             
      else if (email.lastIndexOf(".") <= email.indexOf("@")) { 
       f=1;
      }
      else if (email.indexOf("@") == email.length-1) { 
       f=1;
      }
      else if (email.indexOf("..") >=0) {
       f=1;
      }
      else if (email.indexOf(".") == email.length-1) { 
       f=1;          
      }
   if(f==1)                      
   {
       alert("Please Enter Valid Email");
       document.forms[0].emailId.focus();
       return false;
   }        
}

function allValidChars(email) {
  var parsed = true;
  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-_";
  for (var i=0; i < email.length; i++) {
    var letter = email.charAt(i).toLowerCase();
    if (validchars.indexOf(letter) != -1)             
      continue;
    parsed = false;
    break;
  }        
  return parsed;
}

Tuesday, March 2, 2010

Download Java Projects,.Net Projects

To download java projects and .net projets which were very helpful for java & .net academic students visit the following,and to improve their knowledge in java or .net.

http://downloadjavaprojects.blogspot.com/

http://downloaddotnetprojects.blogspot.com

Monday, March 1, 2010

Eenadu Computer Articles

To know about new and updated information in Computer Technology in telugu language from Eenadu Paper Eenadu Articles that are printed on every thursday from the months of December 2009- February 2010 then Click Here to Download those articles in Pdf format.