81,091
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<title></title>
<!-- jQuery -->
<script type="text/javascript" src="http://5am.jp/common/js/jquery-1.3.1.min.js"> </script>
<!-- ui tabs.js -->
<script type="text/javascript" src="http://5am.jp/common/js/ui.core.js"> </script>
<script type="text/javascript" src="http://5am.jp/common/js/ui.tabs.js"> </script>
<%
int index = -1;
String text3 = request.getParameter("text3");
if (text3 != null) {
//out.println(text3);
try {
Integer.parseInt(text3);
} catch (Exception e) {
index = 2;
}
} else {
text3 = "3";
}
String text2 = request.getParameter("text2");
if (text2 != null) {
//out.println(text2);
try {
Integer.parseInt(text2);
} catch (Exception e) {
index = 1;
}
} else {
text2 = "2";
}
String text1 = request.getParameter("text1");
if (text1 != null) {
//out.println(text1);
try {
Integer.parseInt(text1);
} catch (Exception e) {
index = 0;
}
} else {
text1 = "1";
}
if (index != -1) {
out.println("<font color='red'>tag " + (index + 1) + " is error. </font>");
}
%>
<script type="text/javascript">
$(function() {
//$('#ui-tab > ul').tabs({ fx: { opacity: 'toggle', duration: 'normal' } });
$('#ui-tab > ul').tabs();
});
function go() {
var index = <%=index%>;
$('#ui-tab> ul').tabs('select', index);
};
</script>
<link href="http://5am.jp/common/css/ui.tabs.css" rel="stylesheet" type="text/css" />
</head>
<body onload="go();">
<form action="testTab.jsp" method="POST">
please input number:
<div id="ui-tab">
<ul>
<li><a href="#fragment-1"><span>tag1</span></a></li>
<li><a href="#fragment-2"><span>tag2</span></a></li>
<li><a href="#fragment-3"><span>tag3</span></a></li>
</ul>
<div id="fragment-1">
<p><input type="text" name="text1" value ="<%=text1%>"/> </p>
</div>
<div id="fragment-2">
<p><input type="text" name="text2" value ="<%=text2%>"/> </p>
</div>
<div id="fragment-3">
<p><input type="text" name="text3" value ="<%=text3%>"/> </p>
</div>
</div>
<input type="submit" value="submit">
</form>
</body>
</html>