| | |
Multiple field validations using javascript
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 10
Reputation:
Solved Threads: 0
JSP Syntax (Toggle Plain Text)
<%@ page language="java" pageEncoding="ISO-8859-1"%> <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@taglib uri="/WEB-INF/struts-html-el.tld" prefix="html_el" %> <%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Listing all cities</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <center><h3>city List</h3></center> </body> <html:form action="/UpdateSuccessAction.do" > <c:forEach var="obj" items="${myBean.result}"> City: <c:out value='${obj.cn}' /><br> Pincode: <html_el:text property="pcList" value="${obj.pc}"/><br><br> </c:forEach> <input type="submit" name="submit" value="save111" onClick="return validpincode(); onSave()"> <p><a href="HomePage.do">HomePage</a></p> </html:form> </html> <script> function onSave() { document.forms[0].action="UpdateSuccessAction.do"; document.forms[0].submit(); }
•
•
Join Date: Oct 2009
Posts: 10
Reputation:
Solved Threads: 0
0
#2 Oct 22nd, 2009
Hi i want the numeric validation of all the pcList values coming from Database in this update jsp which upon clicking save will get saved in the database.I am able to save the values in the database but not able to write(or perform) the required numeric validation javascript.
Please any help would be great.
Thanks Vishal
Please any help would be great.
Thanks Vishal
•
•
Join Date: Oct 2009
Posts: 10
Reputation:
Solved Threads: 0
0
#5 Oct 22nd, 2009
For other's refernce.This is what i did.
JSP Syntax (Toggle Plain Text)
function validpincode() { var len = document.forms[0].pcList.length; for(i=0;i<len;i++) { var s=document.forms[0].pcList[i].value; var regInt = /^[0-9]+$/; if(!regInt.test(s)) { alert("please enter numeric value"); document.forms[0].pcList[i].focus(); return false; } }
![]() |
Similar Threads
- How to Validate multiple textboxes using Required field / javascript function (ASP.NET)
- Multiple script tags? (JavaScript / DHTML / AJAX)
- Multiple field combo box (C#)
- Required field validation (JavaScript / DHTML / AJAX)
- dynamic form-field generation with javascript (JavaScript / DHTML / AJAX)
- help needed in javascript (JavaScript / DHTML / AJAX)
- Php Mysql : Code for Multiple Field Search (PHP)
- Text field length validation in Acrobat 8 (JavaScript / DHTML / AJAX)
- 4 Function Calculator textbox or field control (ASP.NET)
- javascript null..is it a string? (JavaScript / DHTML / AJAX)
Other Threads in the JSP Forum
- Previous Thread: reading .csv using jsp
- Next Thread: Help in JSP : Only a type can be imported x.y resolves to a package
Views: 450 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for JSP
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient project read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write





