Wednesday, April 27, 2005

JS for menu without iFrame


<HTML>
<HEAD>
<TITLE> menu with out iFrame. </TITLE>
</HEAD>
<script>
function showDiv(val){
if(val){
var pos = div1.style.posLeft+div1.style.posWidth;
div2.style.position="absolute";
div2.style.top = div1.style.top;
div2.style.left=pos;
div2.style.display="";

}else
{
div2.style.display="none";
}
}
</script>
<BODY>

<div id="div1" STYLE="position:absolute;left:0;top=10;
cursor:hand;width:60;color:red;background-color:beige;"
onmouseover="showDiv(true)" onmouseout="showDiv(false)">
div code
</div>
<br>This is the menu example with out iFrame.
<DIV id="div2" STYLE="position:relative; color:red;
background-color:beige;font-weight:bold; display:none" >
<Table onmouseover="showDiv(true)"
onmouseout="showDiv(false)"border='0'>
<tr>
<td>
one value
</td>
</tr>
<td>
two value
</td>
</tr>
</Table>
</DIV>
</BODY>
</HTML>


Tuesday, April 26, 2005

Java Script to trim the text

function trim(object){
object.value=object.value.replace(/^\s+/,'').replace(/\s+$/,'');
}

DHTML code for adding and deleting rows dynamically


<HTML>
<HEAD>
<TITLE> Testing Table </TITLE>

<SCRIPT LANGUAGE="JAVASCRIPT">
function addRow(id) {
var table = eval(id);
var templateTR = table.tBodies[0].childNodes[0];
var tr = templateTR.cloneNode(true);
tr.style.display = "";
table.tBodies[0].appendChild(tr);
}

function deleteRow(id){
var checkValue = 0;
var table = eval(id);
var templateTR = table.tBodies[0].childNodes;
var deleteSearchIds = "";

if (templateTR.length - 1 == 0) {
alert ("No search criteria available.")
return false;
} else {
for(var i=templateTR.length-1; i>0; i--){
var checkbox=templateTR[i].firstChild.firstChild;
if ((checkbox.type == "checkbox")
&&(checkbox.checked == true)){
deleteSearchIds += checkbox.value + ":";
table.tBodies[0].removeChild(templateTR[i]);
}
}
}
}
</SCRIPT>
</HEAD>

<BODY BGCOLOR="ghostwhite" onload="addRow('tempTable')">
<BR><BR><BR><BR >
<CENTER>
<FORM NAME="testForm">
<TABLE NAME="table1" id="tempTable">
<TBODY>
<TR STYLE="DISPLAY: none">
<TD>
<INPUT NAME="CHECK" TYPE="checkbox">
</TD>
<TD>
<INPUT NAME="NAME" >
</TD>
<TD>
<INPUT NAME="HTNO" >
</TD>
</TR>
<TR>
<TD> </TD>
<TD>
<INPUT NAME="NAME" TYPE="button" VALUE="ADD"
ONCLICK="addRow('tempTable')">
</TD>
<TD>
<INPUT NAME="HTNO" TYPE="button" VALUE="DELETE"
ONCLICK="deleteRow('tempTable')">
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>

Java Script to Split text having a delemeter

Enter some text with delemeter ':' in text box.
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<script language="javascript">
function unique(){
var doctypes = document.forms[0].t1.value;
var abc = doctypes.split(":");
alert(doctypes);
var k = Math.floor(abc[0]/1000);
alert(abc[0]);
for ( i = 1; i < abc.length; i++){

if(Math.floor(abc[i]/1000) != k)
return false;
alert(abc[i]);
}
return true;
}
</script>
<BODY>
<form name="hi">
<input type="text" name="t1" onblur="unique();">
</form>
</BODY>
</HTML>

Monday, April 25, 2005

Java Script for putting corsor at the end of text in text area

Java Script for putting corsor at the end of text in text area

//Set focus for text area.
function setFocus(){
tr = document.forms[0].TextAreaName.createTextRange();
tr.collapse(false);
tr.select();
}

Java Script to make model window

Java Script to make model window put onblur="javascript:window.top.focus()" for the body.

Saturday, April 23, 2005

Workflow

You know how web applications are being used every where!!! Workflow is an added advantage to web applications. Ofcourse this is the requirement. Now many organizations are building their own wokflow engines. Here I am posting this regarding the discussion of problems being faced by workflow engine users and builders.

In every business environment two elements affect the overall efficiency of the business cycle: task time and transfer time. Task time is the actual time it takes to perform a specific business action, such as filling out a purchase order request form. Transfer time, the time between when specific tasks are performed, has two elements: queue time (the time an item spends in the ‘INBOX’) and physical transfer time (the time an item spends ‘in the mail’). Although both task time and transfer time can slow down a process, transfer time is usually the worst culprit: 90% of a typical business cycle is attributed to transfer time.

Businesses use productivity software, such as office suites, to reduce task time by increasing the efficiency of the individual tasks. This practice yields tangible results that are highly visible, however, it must be kept in mind that the task time being optimized still accounts for only 10% of the entire business cycle. The greatest savings can be realized through optimizing the remaining 90% of the business cycle: the portion expended as transfer time. workflow engine automates this part of the cycle the flow of work between the tasks, making it able to increase the overall efficiency of a business process to the maximum extent.

workflow is completely depends on organization only because the structure and flow is specific to organization. The comman things here are every person have some role. work will flow on making some desitions called business rules , and so on.....