I have one syntax to find something from desktop on server, the script is as below, I actually speaking don't know anything in this script.
It creates a window, where i get a drop down boxes with folder names given below and a blank box where i have to put the folder name to search. and then I have to click on the "Click to Find" button in window by mouse. What I need is instead on using the mouse click i should get the results after pressing "enter" on keyboard, can anyone please help me on this.
<html>
<head>
<title>:: Desktop Search ::</title>
<style>
.submit { cursor: hand;border:none; background-color:white; font-family:arial: font-size:11pt;font-weight:bold; }
</style>
<script language="javascript">
// Global variables
var curdate = new Date();
var year = curdate.getYear(); // eg 2008
var yr = year.toString();
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = "";
}
function putDefault(el) {
if (el.value=="") el.value = el.defaultValue;
}
function setPath()
{
document.frm1.path.value = "";
var folder = document.frm1.folder.value;
var slash = document.frm1.slash.value;
var path = document.frm1.DefaultPath.value+slash+folder+slash;
document.frm1.path.value = path;
}
function setActualPath()
{
var slash = document.frm1.slash.value;
var ActualPath = document.frm1.path.value+document.frm1.PID.value;
document.forms[0].action= ActualPath;
document.forms[0].reset();
return true;
}
function Search()
{
if ( setActualPath()==false ) alert("Hello");
}
</script>
</head>
<body>
<center>
<form action="\\172.20.128.15\Usdp\tnsi\NEWSTRUC" name="frm1" method="post" target="_blank">
<p>
<select name="folder" onChange="setPath()">
<option value="0"> Select Folder </option>
<option value="CCA"> CCA </option>
<option value="FIN"> FIN </option>
<option value="BUF"> BUF </option>
<option value="OMA"> OMA </option>
<option value="ITA"> ITA </option>
<option value="AUA"> AUA </option>
<option value="TEL"> TEL </option>
<option value="POA"> POA </option>
<option value="OTZ"> OTZ </option>
<option value="HEA"> HEA </option>
</select>
<INPUT type="text" id="PID" size="13" Value="Enter Project No." onclick='clearDefault(this)' onblur='putDefault(this);'>
</b>
<p>
<INPUT class="submit" type="submit" tabindex="1" value="Click To Find" onClick="setActualPath()">
<INPUT type="hidden" name="path" value="">
<INPUT type="hidden" name="slash" value="\">
<INPUT type="hidden" name="DefaultPath" value="\\172.20.128.15\Usdp\tnsi\NEWSTRUC">
<INPUT type="hidden" name="ActualPath" value="">
</form>
</center>
</body>
</html>