Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 504 additions and 0 deletions
<%--
Document : index
Created on : Nov 4, 2017, 9:23:05 AM
Author : nim_13515091
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<form name="Name Input Form" action="Order.jsp">
Enter Your Name:
<input type="text" name="name" value="" />
<input type="submit" value="OK" />
</form>
</body>
</html>
function loginValidation() {
var username = document.forms["loginform"]["username"];
var pwd = document.forms["loginform"]["password"];
var usrVerify = Validate(username, "empty");
var pwdVerify = Validate(pwd, "empty");
return (usrVerify && pwdVerify);
}
function editProfileValidation() {
var name = document.forms["editprofile-form"]["your-name"];
var phone = document.forms["editprofile-form"]["phone-number"];
var nameVerify = Validate(name, "empty", 0, 20, "length");
var phoneVerify = Validate(phone, "empty", 9, 12, "length");
return (nameVerify && phoneVerify);
}
function Validate(inputArea, type1, min = 0, max = 0, type2 = null, type3 = null) {
var error = GetErrorMessage(inputArea.value, type1, min, max);
if(error === "") {
if (type2 != null) {
error = GetErrorMessage(inputArea.value, type2, min, max);
console.log(type2 + "length");
}
if (error === "") {
if (type3 != null) {
error = GetErrorMessage(inputArea.value, type3, min, max);
}
}
}
if(error !== "" && inputArea.nextElementSibling === null) {
var errorEl = document.createElement("p");
errorEl.innerHTML = error;
errorEl.className = "error";
insertAfterElement(errorEl, inputArea);
inputArea.addEventListener("blur", function() {
var error = GetErrorMessage(inputArea.value, type1, min, max);
if(error === "") {
if (type2 != null) {
error = GetErrorMessage(inputArea.value, type2, min, max);
}
if (error === "") {
if (type3 != null) {
error = GetErrorMessage(inputArea.value, type3, min, max);
}
}
}
if (error === ""){
this.nextSibling.remove();
}
},true);
}
return (error === "");
}
function insertAfterElement(el, src) {
src.parentNode.insertBefore(el, src.nextSibling);
}
function GetErrorMessage(textArea, type, min = 0, max = 0) {
var validateText = "";
switch(type) {
case "empty" :
if(isEmpty(textArea)) {
validateText = "Fill in the field";
}
break;
case "email" :
if(!isEmail(textArea)) {
validatedText = "Invalid Email Address";
}
break;
case "number" :
if(isNumber(textArea)){
validateText = "Fill in with only number";
}
break;
case "length" :
if (!isLengthEqual(textArea,min,max)){
validateText = "Character must be between " + min.toString() + " and " + max.toString() + " long";
}
break;
}
return validateText;
}
function isEmpty(textArea) {
return (textArea.match(/^s+$/) || textArea == "");
}
function isNumber(textArea) {
return (!isNaN(textArea));
}
function isLengthEqual(textArea, min, max){
return (textArea.length >= min && textArea.length <= max);
}
function isEmail(textArea) {
return (textArea.match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+/));
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<%--
Document : response
Created on : Nov 4, 2017, 9:26:56 AM
Author : nim_13515091
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<jsp:useBean id="mybean" scope="session" class="org.mypackage.hello.NameHandler" />
<jsp:setProperty name="mybean" property="name" />
<h1>Hello, <jsp:getProperty name="mybean" property="name" />!</h1>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
;PHPStorm
[xdebug]
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
xdebug.profiler_enable=0
xdebug.max_nesting_level=700
xdebug.remote_host=192.168.0.1 # your ip
;Netbeans
;[xdebug]
;xdebug.remote_enable=1
;xdebug.remote_handler=dbgp
;xdebug.remote_mode=req
;xdebug.remote_host=192.168.0.1 # your ip
;xdebug.remote_port=9000
\ No newline at end of file
mocks/complete-order.PNG

47.1 KiB

mocks/edit-preferred-location.PNG

13.1 KiB

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.