[JavaScript] change a mouse cursor

□Abstract
サブミットボタン押下
確認ダイアログ
YES:マウスポインタを砂時計にする
NO:サブミットボタン押下前に戻る

==sample.jsp======================================
<'?xml version="1.0" encoding="UTF-8" ?>
<'!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<'%@ page contentType="text/html;charset=UTF-8" language="java" %>
<'%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<'%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<'%@ page session="true" %>
<'html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<'head>
<'meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<'meta http-equiv="Content-Style-Type" content="text/css" />
<'meta http-equiv="Content-Script-Type" content="text/javascript" />
<'link rel="stylesheet" href="/hlikk-erms/css/vbcp-main.css" type="text/css" />

<'!-- ##### JAVASCRIPT START ##### -->
<'script type="text/javascript" language="javascript">

function loadOpe(){
status='${sampleScope.status}';

if (status == 1) {
msg = '<'spring:message code="sample.label.greeting"/>';
}

alert(msg);

}


function submitOpe(){//サブミットボタン押下

status='${sampleScope.status}';

if (status == 1) {
msg = '<'spring:message code="sample.label.greeting"/>';
}

res=window.confirm(msg);

if(res == true){
document.body.style.cursor = "wait";//マウスポインタを砂時計に変更
return true;
}
else{
return false;
}
}


<'/script>
<'!-- ##### JAVASCRIPT END ##### -->

<'title>sample.jsp<'/title>
<'/head>
<'body onLoad="loadOpe()">

<'form action="sample.form" method="post">

<'td><'spring:message code="sample.label.greeting"/><'/td>

<'input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}">

<'!--##SUBMIT## -->
<'c:if test="${sampleScope.status == 1}">
<'input type="submit" name="_eventId_sampleSubmit"
value="<'spring:message code="sample.button.theSubmit"/>" onclick="return submitOpe()">
<'/c:if>

<'/form>

<'/body>

<'/html>

==================================================
==applicationContext.xml==========================
<'!-- resource -->
<'bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<'property name="basenames">
<'list>
<'value>sampe-message<'/value>
<'/list>
<'/property>
<'/bean>
==================================================
==sample-message.properties=======================
sample.label.greeting=HELLO!
==================================================


tag:
JavaScript HTML JSTL Spring cursor mouse

tag : JavaScript HTML JSTL Spring cursor mouse

2007-05-09 01:06 : engineering : コメント : 0 : トラックバック : 0 :
コメントの投稿
非公開コメント

« next  ホーム  prev »

search

ad



counter


tag cloud

category cloud