관리 메뉴

moozi

register.jsp 본문

TIS_2017/응용sw_2기

register.jsp

moozi 2017. 10. 26. 13:31

<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

<%@include file="../include/header.jsp" %>

<script>

$(document).ready(function(){

$("#submit").click(function(){

//msg리셋

$("#msg1").html("");

$("#msg2").html("");

$("#msg3").html("");

//validation작업

if($("#title").val()==""){

$("#msg1").html("<b style='color:red'>title은 필수 입력항목입니다.</b>");

$("#title").focus();

return false;

}

if($("#content").val()==""){

$("#msg2").html("<b style='color:red'>content는 필수 입력항목입니다.</b>");

$("#content").focus();

return false;

}

if($("#writer").val()==""){

$("#msg3").html("<b style='color:red'>writer는 필수 입력항목입니다.</b>");

$("#writer").focus();

return false;

}

});

});

</script>

<form id="form1" role="form" method="post">

<div class="box-body">

<div class="form-group">

Title

<input type="text" id="title" name="title" class="form-control" placeholder="Title">

<span id="msg1"></span>

</div>

<div class="form-group">

Content

<input type="text" id="content" name="content" class="form-control" placeholder="Content">

<span id="msg2"></span>

</div>

<div class="form-group">

Writer

<input type="text" id="writer" name="writer" class="form-control" placeholder="Writer">

<span id="msg3"></span>

</div>

</div>

<div class="box-footer">

<div class="form-group">

<button type="submit" id="submit" class="btn btn-primary">Sumbit</button>

</div>

</div>

</form>


<%@include file="../include/footer.jsp" %>

'TIS_2017 > 응용sw_2기' 카테고리의 다른 글

ojdbc6.jar  (0) 2017.10.31
ex04 pom.xml  (0) 2017.10.26
프로젝트 관심분야  (14) 2017.10.24
스프링연습문제04  (0) 2017.10.20
jQuery href header  (0) 2017.10.20
Comments