onclick与< html:submit>无法正常工作 [英] onclick not working properly with <html:submit>

查看:66
本文介绍了onclick与< html:submit>无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds,

i有一个表单,其中有2个输入文本框,值正在进入文本框,当我将2个文本框留空并点击提交时,java脚本会显示消息这两个字段是空白的.....现在的问题是,当我将文本框留空时,消息显示出来......当我点击确定...然后,而不是向我显示页面,它给我一个例外 - >

类型异常​​报告


消息


描述服务器遇到内部错误()阻止它来自履行此请求。


例外


javax.servlet.ServletException:不正确的整数值:列''Publicity_Code'的'''' '第1行

org.apache.struts.action.RequestProcessor.processE xception(RequestProcessor.java:545)

org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:486)

org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)

org.apache.struts.action.ActionServlet .doGet(Actio nServlet.java:507)

javax.servlet.http.HttpServlet.service(HttpServlet .java:690)

javax.servlet.http.HttpServlet。 service(HttpServlet .java:803)


根本原因

java.sql.SQLException:不正确的整数值:'' ''对于第1行的列''Publicity_Code''

com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:946)

com.mysql.jdbc .MysqlIO.checkErrorPacket(MysqlIO.ja va:2985)

com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:16 31)

com.mysql.jdbc .MysqlIO.sqlQueryDirect(MysqlIO.java:1723)

com.mysql.jdbc.Connection.execSQL(Connection.java:3256)

com.mysql.jdbc.PreparedStatement .executeInternal(P reparedStatement.java:1313)

com.mysql.jdbc.PreparedStat ement.executeUpdate(Pre paredStatement.java:1585)

com.mysql.jdbc.PreparedStatement.executeUpdate(Pre paredStatement.java:1500)

com.mysql.jdbc。 PreparedStatement.executeUpdate(Pre paredStatement.java:1485)

org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStat ement.executeUpdate(DelegatingPreparedStatement.ja va:101)

宣传.BdgtMastAction.execute(BdgtMastAction.ja va:57)

org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:484)

org.apache .struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)

org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:507)

javax.servlet.http.HttpServlet.service(HttpServlet .java:690)

javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

------------------------- ------------------------ -------------------------------


Apache Tomcat


y这是怎么回事?

我正在使用struts标签 - >

展开 | 选择 | Wrap | 行号

解决方案

伙计们仍然没有解决方案.... plz help..even与传统的

展开 | 选择 | Wra p | 行号


< blockquote>显示表单HTML和Javascript验证码。



显示表单HTML和Javascript验证码。



hi thanx for the response

herz my jsp - >

[HTML]

<%@ page language =" java"的contentType = QUOT; text / html的; charset = ISO-8859-1"

pageEncoding =" ISO-8859-1"%>

<!DOCTYPE html PUBLIC" - // W3C / / DTD HTML 4.01 Transitional // EN" http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri =" /WEB-INF/struts-html.tld"前缀= QUOT; HTML" %>

<%@ taglib uri =" /WEB-INF/struts-logic.tld"前缀= QUOT;逻辑QUOT; %>

<%@ taglib uri =" /WEB-INF/struts-bean.tld"前缀= QUOT;豆" %>

< html:html>

< head>

< title>预算主管理< / title>

< meta name =" GENERATOR" content =" Microsoft FrontPage 3.0"

< SCRIPT LANGUAGE =" JavaScript" SRC =" bscript.js">< / SCRIPT>

< meta http-equiv =" Content-Type"含量=" text / html的; charset = ISO-8859-1">

< / head>

< body topmargin =" 0" LEFTMARGIN = QUOT; 0" bgproperties =" fixed">

< div align =" left">

< html:form action =" / BdgtMastAction"名称= QUOT; bdgtmastForm"类型= QUOT; publicity.BdgtMastForm" method =" get">

< table border =" 0" width =" 100%">

< tr>

< td width =" 100%" BGCOLOR = QUOT;#DFDFFF" background =" images / niceblue.gif">< font face =" Tahoma"

color ="#000000">< strong> B udge t& nbsp;& NBSP; M aste r< / strong>< / font>< / td>

< / tr>

< / table>

< div align =" left">


< table width =" 60%" height =" 127">

< tr>

< td valign =" top"宽度= QUOT; 50%" height =" 34">< strong>< small>< font face =" Verdana">< / font>< / small>< / strong>< / td>

< td width =" 50%" height =" 34">< / td>

< / tr>

< tr>

< td valign = QUOT;顶"宽度= QUOT; 50%" height =" 27">< strong>< small>< font face =" Verdana"> Branch< / font>< / small>< / strong>< / td>

< td width =" 50%" height =" 27">


< html:hidden name =" bdgtmastForm"属性= QUOT;选项" value =" new" />

< p>

< html:select property =" branch" size =" 1">


< html:option value =" Bombay">< / html:option>

< html:option value =" Ahmedab​​ad">< / html:option>

< html:option value =" Madras">< / html:option>

< html:option value =" Bangalore">< / html:option>

< html:option value =" Calcutta">< / html:选项>

< html:option value =" Hyderabad">< / html:option>

< html:option value =" Pune"> ;< / html:选项>

< html:选项值=" Lucknow">< / html:选项>

< html:选项值=" Jaipur">< / html:option>

< html:option value =" Patna">< / html:option>

< html:option value =" Cochin">< / html:option>

< html:option value =" Chandigarh">< / html:option>

< html:option value ="博帕尔">< / html:option>


< / html:select>

< / p>

< / td>

< / tr>

< tr>

< td width =" 50%QUOT; height =" 25">< strong>< small>< font face =" Verdana">宣传代码< / font>< / small>< / strong>< / td>

< td width =" 50%" height =" 25">

< html:text name =" bdgtmastForm"属性= QUOT; publicity_Code"大小= QUOT; 5英寸maxlength =" 5">< / html:text>


< / tr>

< tr>

< td width =" 50%" height =" 25">< strong>< small>< font face =" Verdana">年度预算Alloted(< em> Rs< / em>)< / font>< / small> ;< / strong>< / td>

< td width =" 50%" height =" 25">

< html:text property =" budget"名称= QUOT; bdgtmastForm"大小= QUOT; 10" MAXLENGTH = QUOT; 10" >< / html:text>

< / td>

< / tr>

< / table>

< / div>


< p align =" left">

<! - < html :button property =" thesubmit"值= [提交"的onclick = QUOT;一切(形式)">< / HTML:按钮> - >

< html:submit value =" Submit"属性= QUOT; thesubmit"的onclick = QUOT;一切(形式)">&安培; NBSP;< / HTML:提交>

<! - < input type =" button"命名= QUOT; thesubmit"值= [提交"的onclick = QUOT;一切(形式)">&安培; NBSP; - >

< / p>


< hr>

< strong>< small>< ; font color ="#0080C0">

< p align =" center">?< / font>< font color ="#0080C0" face =" Verdana">回复 - 公司

1998-1999< / font>< / small>< / strong>

< / html:form> ;

< / div>

< / body>

< / html:html>

[/ HTML]


herz my java script - >

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


hi frnds,
i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are blank.....the problem now is when i leave the text boxes blank the message appears...and when i click ok...then instead of showing me the page its giving me an exception-->
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Incorrect integer value: '''' for column ''Publicity_Code'' at row 1
org.apache.struts.action.RequestProcessor.processE xception(RequestProcessor.java:545)
org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:486)
org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)


root cause

java.sql.SQLException: Incorrect integer value: '''' for column ''Publicity_Code'' at row 1
com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:946)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:2985)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:16 31)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :1723)
com.mysql.jdbc.Connection.execSQL(Connection.java: 3256)
com.mysql.jdbc.PreparedStatement.executeInternal(P reparedStatement.java:1313)
com.mysql.jdbc.PreparedStatement.executeUpdate(Pre paredStatement.java:1585)
com.mysql.jdbc.PreparedStatement.executeUpdate(Pre paredStatement.java:1500)
com.mysql.jdbc.PreparedStatement.executeUpdate(Pre paredStatement.java:1485)
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStat ement.executeUpdate(DelegatingPreparedStatement.ja va:101)
publicity.BdgtMastAction.execute(BdgtMastAction.ja va:57)
org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
--------------------------------------------------------------------------------

Apache Tomcat

y is this happening??
im using struts tags-->

Expand|Select|Wrap|Line Numbers

解决方案

guys still no solution....plz help..even with the conventional

Expand|Select|Wrap|Line Numbers


Show your form HTML and Javascript validation code.


Show your form HTML and Javascript validation code.

hi thanx for the response
herz my jsp-->
[HTML]
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html>
<head>
<title>Budget Master Administration</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<SCRIPT LANGUAGE="JavaScript" SRC="bscript.js"></SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body topmargin="0" leftmargin="0" bgproperties="fixed">
<div align="left">
<html:form action="/BdgtMastAction" name="bdgtmastForm" type="publicity.BdgtMastForm" method="get">
<table border="0" width="100%">
<tr>
<td width="100%" bgcolor="#DFDFFF" background="images/niceblue.gif"><font face="Tahoma"
color="#000000"><strong>B u d g e t&nbsp;&nbsp; M a s t e r</strong></font></td>
</tr>
</table>
<div align="left">

<table width="60%" height="127">
<tr>
<td valign="top" width="50%" height="34"><strong><small><font face="Verdana"></font></small></strong></td>
<td width="50%" height="34"></td>
</tr>
<tr>
<td valign="top" width="50%" height="27"><strong><small><font face="Verdana">Branch</font></small></strong></td>
<td width="50%" height="27">

<html:hidden name="bdgtmastForm" property="option" value="new"/>
<p>
<html:select property="branch" size="1">

<html:option value="Bombay"></html:option>
<html:option value="Ahmedabad"></html:option>
<html:option value="Madras"></html:option>
<html:option value="Bangalore"></html:option>
<html:option value="Calcutta"></html:option>
<html:option value="Hyderabad"></html:option>
<html:option value="Pune"></html:option>
<html:option value="Lucknow"></html:option>
<html:option value="Jaipur"></html:option>
<html:option value="Patna"></html:option>
<html:option value="Cochin"></html:option>
<html:option value="Chandigarh"></html:option>
<html:option value="Bhopal"></html:option>


</html:select>
</p>
</td>
</tr>
<tr>
<td width="50%" height="25"><strong><small><font face="Verdana">Publicity Code </font></small></strong></td>
<td width="50%" height="25">
<html:text name="bdgtmastForm" property="publicity_Code" size="5" maxlength="5"></html:text>

</tr>
<tr>
<td width="50%" height="25"><strong><small><font face="Verdana">Annual Budget Alloted (<em>Rs</em>)</font></small></strong></td>
<td width="50%" height="25">
<html:text property="budget" name="bdgtmastForm" size="10" maxlength="10" ></html:text>
</td>
</tr>
</table>
</div>

<p align="left">
<!-- <html:button property="thesubmit" value="Submit" onclick="everything(form)"></html:button> -->
<html:submit value="Submit" property="thesubmit" onclick="everything(form)">&nbsp;</html:submit>
<!-- <input type="button" name="thesubmit" value="Submit" onclick="everything(form)">&nbsp; -->
</p>

<hr>
<strong><small><font color="#0080C0">
<p align="center">?</font><font color="#0080C0" face="Verdana">Response - Corporate
1998-1999</font></small></strong>
</html:form>
</div>
</body>
</html:html>
[/HTML]

herz my java script-->

Expand|Select|Wrap|Line Numbers


这篇关于onclick与&lt; html:submit&gt;无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆