⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 event.htm

📁 Windows Web脚本开发指南/(美) Dan Heflin, Todd Ney著 的源码
💻 HTM
字号:
<html XMLNS:UD>

<head>
	<title>HTC Wizard</title>
</head>
<script src="utilVBS.vbs" language="VBScript"></script>
<script src="utilJS.js" language="JScript"></script>
<script language="JavaScript">
function saveData(){
var i;
var data;
var cnt = 0;

	document.all.objUD.load("DHTMLWiz");
	for (i = 0; i < document.all.txtEventName.length; i++){
		if (! validData(i)) 
			return;

		if (trimText(document.all.txtEventName(i).value) != ""){
			cnt++;
			data = document.all.txtEventName(i).value;
			if (trimText(document.all.txtEventID(i).value) != "")
				data = data + '||' + document.all.txtEventID(i).value;
			else
				data = data + '||' + ' ';
			document.all.objUD.setAttribute("DWEvent" + eval(cnt), data);
		}
	}

	document.all.objUD.setAttribute("DWEventCount", eval(cnt));
	document.all.objUD.setAttribute("DWBtnAction", document.all.btnNext.value );
	document.all.objUD.save("DHTMLWiz");		
	window.navigate("attach.htm");	

}
function validData(idx){
var valid = true;

	if (trimText(document.all.txtEventName(idx).value) == ""){
		if (trimText(document.all.txtEventID(idx).value) != "")
			valid = false;
	}
	if (trimText(document.all.txtEventID(idx).value) == "")
		if (trimText(document.all.txtEventName(idx).value) != ""){
			valid = false;
	}

	if (valid == false)
		alert("Data has been entered for row " + eval(1 + idx) + " but a name is required.");
	
	return valid;
	
}
function initText(){
var action;	
var cnt;
var arrData = new Array();
var strData;

	document.all.objUD.load("DHTMLWiz");
	action = document.all.objUD.getAttribute("DWBtnAction");
	if (action == "<< Back"){
		cnt = document.all.objUD.getAttribute("DWEventCount");
		for (i = 0; i < cnt; i++){
			strData = document.all.objUD.getAttribute("DWEvent" + eval(i + 1));
			arrData = strData.split("||");
			document.all.txtEventName(i).value = trimText(arrData[0]);
			document.all.txtEventID(i).value = trimText(arrData[2]);
		}
	}
	else{
		removeUDAttributes();
	}
	
}
function removeUDAttributes(){
var i;

	document.all.objUD.load("DHTMLWiz");	
	for (i = 0; i < 10; i++)
		document.all.objUD.removeAttribute("DWEvent" + eval(i));

	document.all.objUD.removeAttribute("DWEventCount");
	document.all.objUD.save("DHTMLWiz");	
}
</script>

<body bgcolor="#00CCFF" onload="initText()">
<UD:UserData id="objUD" style="behavior:url(#default#userdata)" />
<p align="center">
<br>
<b><font size="6">HTML Component Wizard<br>
</font>
<br>
<font size="5">Create Event Elements Page</font>
</b>
<table border="1" width="100%" height="195">
  <tr>
    <td width="30%" height="189" valign="top"><br>
      The Event page will create the events for the HTML component. The events
      are fired by the HTML component to its container.&nbsp;<br>
      <br>
      <font color="#FF0000">*</font> required field
    </td>
    <td width="70%" height="189">
        <form>
        <table border="1" width="100%">
          <tr>
            <td width="65%"><b>Name<font color="#FF0000">*</font></b></td>
            <td width="35%"><b>ID <font color="#FF0000">*</font></b></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
          <tr>
            <td width="65%"><input type="text" name="txtEventName" size="43"></td>
            <td width="35%"><input type="text" name="txtEventID" size="23"></td>
          </tr>
        </table>
        </form>
  	</tr>
</table>
<br>
<table border="0" width="100%">
	<tr>
   		<td width="50%"></td>
   		<td width="20%"><input type="button" value="Cancel" onclick="closeWindow()" name="btnCancel"></td>
   		<td width="15%"><input type="button" value="<< Back" onclick="goBack('method.htm')" name="btnBack"></td>
   		<td width="15%"><input type="button" value="Next >>" onclick="saveData()" name="btnNext"></td>
   </tr>
</table>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -