jquery获取表单值和jquery提交数据
2011-10-10 18:33
411 查看
(www.aimeiba.org/blog韩威编写。)<%--
=================================================================
Licensed Materials - Property of IBM
WebSphere Commerce
(C) Copyright IBM Corp. 2011 All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
=================================================================
--%>
<!-- start leave.jsp -->
<br clear="all" />
<div>
<%
out.flush();
%> <c:import
url="${jspStoreDir}UserArea/AccountSection/ConsultationSubsection/ConsultationResultDisplay.jsp">
<c:param name="storeId" value="${WCParam.storeId}" />
<c:param name="catalogId" value="${catalogId}" />
<c:param name="langId" value="${catalogEntryID}" />
<c:param name="productID" value="${catalogEntryID}" />
</c:import> <%
out.flush();
%> <wcf:url var="LeaveWordsURL" value="UserLeave">
<wcf:param name="langId" value='${langId}' />
<wcf:param name="storeId" value='${WCParam.storeId}' />
<wcf:param name="catalogId" value='${WCParam.catalogId}' />
</wcf:url> <script type="text/javascript"
src="<c:out value="${jsAssetsDir}../comm/javascript/jquery.blockUI.js"/>"></script>
<script type="text/javascript">
function displayDiv(){
$.blockUI({
message: $('#leave'),
css: {
top: '50%',
left: '50%',
textAlign: 'left',
marginLeft: '-240px',
marginTop: '-145px',
width: '450px',
background:'#CCC'
}
});
$('.blockOverlay').click($.unblockUI);
$('.close').click($.unblockUI);
}
function submitForm()
{
var title= $("#leavetitle").val();
var content = $("#leaveContent").val();
var authorId = $("#authorId").val();
var catentryId =$("#catentryId").val();
if(title == "" || content=="")
{
alert("no null");
return false;
}
var params=
{
'title':title,
'leaveContent':content,
'authorId':catentryId,
'catentryId':catentryId
}
$.get('<c:out value='${LeaveWordsURL}'/>',params,function(data){
alert('<fmt:message key='LAVAE_MESSAGE_SUCCESS' bundle='${storeText}'></fmt:message>');
$('.blockOverlay').click($.unblockUI);
$('.close').click($.unblockUI);
document.getElementById("leave").style.display= 'none';
});
}
function close(){
alert("fffffffffff");
$('.blockOverlay').click($.unblockUI);
$('.close').click($.unblockUI);
document.getElementById("leave").style.display= 'none';
}
</script>
<div style="padding: 50px; display: none;" id="leave"><c:if
test="${userId !='-1002' }">
<a href="#" onclick="close();return false;">close</a>
<p class="STYLE1"><fmt:message key="leve" bundle="${storeText}"></fmt:message></p>
<form method="get" name="leave"><fmt:message key="LEAVE_Titile"
bundle="${storeText}" />:<input name="title" type="text" size="40"
id="leavetitle" /> <br />
<fmt:message key="LEAVE_CONTENT" bundle="${storeText}"></fmt:message>:
<textarea name="leaveContent" cols="41" rows="10" wrap="physical"
id="leaveContent"></textarea>
</p>
<p><input type="hidden" name="authorId" value="-1000" id="authorId" />
<input type="hidden" name="catentryId" value="${catalogEntryID}"
id="catentryId" /></p>
<p><input type="submit" id="submit"
onclick="submitForm();return false;" /> <input type="reset" /></p>
</form>
</c:if> <wcf:url var="LoginURL" value="AjaxLogonForm">
<wcf:param name="langId" value="${langId}" />
<wcf:param name="storeId" value="${WCParam.storeId}" />
<wcf:param name="catalogId" value="${WCParam.catalogId}" />
</wcf:url> <c:if test="${userId =='-1002' }">
<script type="text/javascript">
function validate(){
if(${userId =='-1002' }){
$('#nologin').innerHTML = "<a href='<c:out value= "${LoginURL}"/>'> <c:out value= "<fmt:message key='LEAVE' bundle='${storeText}' />"/></a>";
}
}
</script>
<fmt:message key="Please_LOGIN" bundle="${storeText}" />
<span id="nologin" style="color: #FF0000;">nn</span>
</c:if></div>
<span class="primary_button"> <span class="button_container">
<span class="button_bg"> <span class="button_top"> <span
class="button_bottom"> <a id="userleave" onclick="displayDiv()">
<fmt:message key="MY_CONS_CONSULT" bundle="${storeText}" /></a> </span> </span> </span> </span> </span></div>
<!-- end leave.jsp -->
我的百度博客地址:http://hi.baidu.com/554768191/blog
=================================================================
Licensed Materials - Property of IBM
WebSphere Commerce
(C) Copyright IBM Corp. 2011 All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
=================================================================
--%>
<!-- start leave.jsp -->
<br clear="all" />
<div>
<%
out.flush();
%> <c:import
url="${jspStoreDir}UserArea/AccountSection/ConsultationSubsection/ConsultationResultDisplay.jsp">
<c:param name="storeId" value="${WCParam.storeId}" />
<c:param name="catalogId" value="${catalogId}" />
<c:param name="langId" value="${catalogEntryID}" />
<c:param name="productID" value="${catalogEntryID}" />
</c:import> <%
out.flush();
%> <wcf:url var="LeaveWordsURL" value="UserLeave">
<wcf:param name="langId" value='${langId}' />
<wcf:param name="storeId" value='${WCParam.storeId}' />
<wcf:param name="catalogId" value='${WCParam.catalogId}' />
</wcf:url> <script type="text/javascript"
src="<c:out value="${jsAssetsDir}../comm/javascript/jquery.blockUI.js"/>"></script>
<script type="text/javascript">
function displayDiv(){
$.blockUI({
message: $('#leave'),
css: {
top: '50%',
left: '50%',
textAlign: 'left',
marginLeft: '-240px',
marginTop: '-145px',
width: '450px',
background:'#CCC'
}
});
$('.blockOverlay').click($.unblockUI);
$('.close').click($.unblockUI);
}
function submitForm()
{
var title= $("#leavetitle").val();
var content = $("#leaveContent").val();
var authorId = $("#authorId").val();
var catentryId =$("#catentryId").val();
if(title == "" || content=="")
{
alert("no null");
return false;
}
var params=
{
'title':title,
'leaveContent':content,
'authorId':catentryId,
'catentryId':catentryId
}
$.get('<c:out value='${LeaveWordsURL}'/>',params,function(data){
alert('<fmt:message key='LAVAE_MESSAGE_SUCCESS' bundle='${storeText}'></fmt:message>');
$('.blockOverlay').click($.unblockUI);
$('.close').click($.unblockUI);
document.getElementById("leave").style.display= 'none';
});
}
function close(){
alert("fffffffffff");
$('.blockOverlay').click($.unblockUI);
$('.close').click($.unblockUI);
document.getElementById("leave").style.display= 'none';
}
</script>
<div style="padding: 50px; display: none;" id="leave"><c:if
test="${userId !='-1002' }">
<a href="#" onclick="close();return false;">close</a>
<p class="STYLE1"><fmt:message key="leve" bundle="${storeText}"></fmt:message></p>
<form method="get" name="leave"><fmt:message key="LEAVE_Titile"
bundle="${storeText}" />:<input name="title" type="text" size="40"
id="leavetitle" /> <br />
<fmt:message key="LEAVE_CONTENT" bundle="${storeText}"></fmt:message>:
<textarea name="leaveContent" cols="41" rows="10" wrap="physical"
id="leaveContent"></textarea>
</p>
<p><input type="hidden" name="authorId" value="-1000" id="authorId" />
<input type="hidden" name="catentryId" value="${catalogEntryID}"
id="catentryId" /></p>
<p><input type="submit" id="submit"
onclick="submitForm();return false;" /> <input type="reset" /></p>
</form>
</c:if> <wcf:url var="LoginURL" value="AjaxLogonForm">
<wcf:param name="langId" value="${langId}" />
<wcf:param name="storeId" value="${WCParam.storeId}" />
<wcf:param name="catalogId" value="${WCParam.catalogId}" />
</wcf:url> <c:if test="${userId =='-1002' }">
<script type="text/javascript">
function validate(){
if(${userId =='-1002' }){
$('#nologin').innerHTML = "<a href='<c:out value= "${LoginURL}"/>'> <c:out value= "<fmt:message key='LEAVE' bundle='${storeText}' />"/></a>";
}
}
</script>
<fmt:message key="Please_LOGIN" bundle="${storeText}" />
<span id="nologin" style="color: #FF0000;">nn</span>
</c:if></div>
<span class="primary_button"> <span class="button_container">
<span class="button_bg"> <span class="button_top"> <span
class="button_bottom"> <a id="userleave" onclick="displayDiv()">
<fmt:message key="MY_CONS_CONSULT" bundle="${storeText}" /></a> </span> </span> </span> </span> </span></div>
<!-- end leave.jsp -->
我的百度博客地址:http://hi.baidu.com/554768191/blog
相关文章推荐
- jquery获取表单数据无刷新提交
- Jquery Jsonp跨域提交表单获取返回数据
- 使用jQuery-Form做表单submit提交,获取响应json数据
- 【Codebase】JQuery获取表单部分数据提交方法
- struts2学习(二)—action获取表单提交数据的三种方式
- 通过jquery的serializearray处理表单数据成json格式,并提交到后台处理
- KindEditor提交用jquery获取不到数据的解决方法
- 针对jquery获取表单数据并且迭代方式
- KindEditor 当用ajax提交表单时获取不到数据。
- 表单中多个请求参数名字相同,服务器到底获取的是哪个请求参数的值,表单的action和get和post提交方式的关系以及提交数据的不同点
- 利用jquery.form.js的ajaxSubmit实现不跳转提交表单数据
- 如何在servlet中获取jsp中form表单提交的变量,以及jsp与servlet之间的数据传递
- jquery validate如何不提交表单就做验证(ajax提交数据)
- Play2.5获取POST请求提交的表单数据
- react表单提交(实现提交时不刷新页面并一键获取到所有数据)
- ***使用jQuery实现跨域提交表单数据
- jquery如何获取用户表单提交值
- 使用KindEditor提交表单后无法获取到数据
- Jquery提交包含特殊字符的表单数据
- 使用jquery 的serialize来提交表单数据