整个过程模仿用户注册,分为三步完成,运行效果如下:
全部代码如下:
<html>
<head>
<title>JavaScript Create User Wizard Example</title>
<script type="text/javascript">
function handleWizardNext()
{
if (document.getElementById('ButtonNext').name == 'step2')
{
document.getElementById('step1').style.display = 'none';
document.getElementById('step2').style.display = '';
document.getElementById('ButtonNext').name = 'step3';
document.getElementById('ButtonPrevious').name = 'step1';
document.getElementById('ButtonPrevious').disabled = '';
document.getElementById('headstep1').style.backgroundColor = 'silver';
document.getElementById('headstep2').style.backgroundColor = 'white';
}
else if(document.getElementById('ButtonNext').name == 'step3')
{
document.getElementById('step2').style.display = 'none';
document.getElementById('step3').style.display = '';
document.getElementById('ButtonNext').name = '';
document.getElementById('ButtonNext').disabled = 'disabled';
document.getElementById('ButtonPrevious').name = 'step2';
document.getElementById('ButtonPrevious').disabled = '';
document.getElementById('SubmitFinal').disabled = '';
document.getElementById('headstep2').style.backgroundColor = 'silver';
document.getElementById('headstep3').style.backgroundColor = 'white';
}
}
function handleWizardPre() {
// console.log("this is to go back previous page");
if (document.getElementById('ButtonPrevious').name == 'step1') {
// display/hide the relevative fieldset
document.getElementById('step2').style.display = 'none';
document.getElementById('step1').style.display = '';
// enable/disable buttons
document.getElementById('ButtonNext').name = 'step2';
document.getElementById('ButtonPrevious').name = '';
document.getElementById('ButtonPrevious').disabled = 'disabled';
document.getElementById('SubmitFinal').disabled = 'disabled';
document.getElementById('SubmitFinal').name = '';
// change navigation color
document.getElementById('headstep2').style.backgroundColor = 'silver';
document.getElementById('headstep1').style.backgroundColor = 'white';
} else if(document.getElementById('ButtonPrevious').name == 'step2') {
// display/hide the relevative fieldset
document.getElementById('step3').style.display = 'none';
document.getElementById('step2').style.display = '';
// enable/disable buttons
document.getElementById('ButtonNext').name = 'step3';
document.getElementById('ButtonNext').disabled = '';
document.getElementById('ButtonPrevious').name = 'step1';
document.getElementById('ButtonPrevious').disabled = '';
document.getElementById('SubmitFinal').name = '';
document.getElementById('SubmitFinal').disabled = 'disabled';
// change navigation color
document.getElementById('headstep3').style.backgroundColor = 'silver';
document.getElementById('headstep2').style.backgroundColor = 'white';
}
}
</script>
<style type="text/css">
#userregisterizard {
width:500px;
height: 350px;
background-color:#EFEFEF;
border-style:solid;
border-width:5px;
border-color:#001111;
}
#userregisterizard #wizardpanel{
padding: 5px;
height: 250;
}
#userregisterizard #buttons{
padding: 5px;
height: 40;
}
#navigationbar {
padding: 2px;
height: 50px;
background-color:silver;
}
</style>
</head>
<body>
<div id="userregisterizard">
<div id="navigationbar">
<label id="headstep1" style="background-color:white">Step 1: Register</label>
<label id="headstep2" style="background-color:silver">Step 2: Detail Profile</label>
<label id="headstep3" style="background-color:silver">Step 3: Finalize</label>
</div>
<div id="wizardpanel">
<fieldset id="step1">
<legend>Create User</legend>
<label>Name<font color="red">*</font>:Enter your preferred user name</label><br>
<input name="wsname" type="text"></br>
<label>Password<font color="red">*</font>:Please use 8~16 characters that will protect your user account</label><br>
<input name="uspassword" type="password"></br>
</fieldset>
<!-- edit yourself profile -->
<fieldset id="step2" style="display:none">
<legend>Edit Profile</legend>
<label>Occupation<font color="red">*</font>:What do you do?</label><br>
<input name="wsname" type="text"></br>
<label>Company<font color="red">*</font>:Which company you are working for</label><br>
<input name="company" type="text"></br>
<label>Hometown<font color="red">*</font>:Where is you hometown</label><br>
<input name="hometown" type="text"></br>
<label>Mobilephone Number<font color="red">*</font>:Can we get your phone number?</label><br>
<input name="phonenumber" type="text"></br>
</fieldset>
<fieldset id="step3" style="display:none">
<legend>Welcome you</legend>
<p>you can see the your user profile what you have entered.<p>
</fieldset>
</div>
<div id="buttons">
<input id="ButtonPrevious" type="button" value="Previous" disabled="disabled" name="" onclick="handleWizardPre()"/>
<input id="ButtonNext" type="button" value="Next" name="step2" onclick="handleWizardNext()" />
<input id="SubmitFinal" type="submit" value="Finish" disabled="disabled" />
</div>
</div>
</body>
</html>
分享到:
相关推荐
Wizard是基于Laravel开发框架开发的一款开源项目(API)文档管理工具。
FTP Wizard 2.0 能让一个对FTP相关知识了解很少的用户访问一个FTP服务器,而且使用的代码很少。FTP的目的是存储信息,保持信息在网络上可用,如果获得许可,用户还可以在FTP上保存文件。 FTP Wizard 使得这些...
lp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txt
自定义的向导控件,一个wizard 向导一定是你的软件迫切需要的吧!
lpwizard用户指南
Mician uWave Wizard 7.5安装程序,需要的可以自行下载
Kext Wizard3.7.10_cn
自动封装生成工具Lp_Wizard使用教程,Lp_Wizard可创建AD,CADENCE,PADS等格式的封装
CUDA VS Wizard 2.9 更新
ionCube loader wizard
vilar wizard
DDK_Wizard为一自称为懒人的杰作,为我们这些懒人带来了方便,用了之后使人不得不想起那句“懒惰促进科技进步”~~,用了就知道,真适合懒人~~
Configuration Wizard
Forming Analysis Wizard For CHS
ionCube 是一款非常优秀的加密软件,功能非常强大,由法国一家公司研发推出。oader-wizard.php 则是一个解密扩展安装引导脚本,方便大家快速安装对ionCube 解密的支持。
LP Wizard 10.5详细使用教程(附图) IPC7351标准封装库 LP Wizard 10.5 安装破解文件以及完整破解教程(亲测win10可用) https://download.csdn.net/download/weixin_43939664/10828592
chess_wizard
介绍vs2005 Wizard的编写问题(英文)
LP Wizard 10.5破解文件。
Xilinx系列FPGA的IP官方使用手册,Clocking Wizard,时钟管理