View Full Version : second form validation
Hi in my jsp page,i have 2 forms.
one is a main form with few fields which i ahve done the validations
there's another form which is a table with multiple rows for users to enter.
how do i do the validation for it.
suppose there's a id in 2nd form with 5 rows how do i validate the field for 5 rows.
06-01-2004, 06:58 AM
You have to post your codes in order for us to help you.
have attached the code
how do i do the validation for risklist,reinsurance which are a multiple rows .
the 2 list are a separate form placed in the main form .
sorry i never attached earlier,now attached the file with this reply.
can anyone help this problem,i have attached the script in my previous reply.
waiting for a reply.
06-03-2004, 07:10 AM
You should post the generated HTML source not the server-side script source. Execute the page then save the html and post it here. And please describe your problem in more detail.
i have attached the view source of my html page.
in my page i have got a table called riskList with a field riskNo which iterates.
i display the rows for user to enter riskNo.so i want to validate so that they enter a valid no without decimals.
hopw u understood.
06-03-2004, 09:58 AM
You are already validating each field onchange.
<input type="text" name="riskList.riskNo" value="2.4" onchange="checkNo(this)" class="inputTxt">
Does checkNo() also check for decimal numbers? I can't see the function because it is in global.js.
yes i tries to check but it prmpts the user only once to enter a valid field after that the focus goes to the next field.
though i forcefully keep my focus there are click on tab the second time it never prompts the message.
06-03-2004, 10:46 AM
For consistency, validate the Risk Nos too after the Save button is clicked, as in other fields.
You can optimize your saveAction() function if you pass the form reference to it.
<input type="button" name="btnSave" value="Save" onclick="saveAction(this.form)" />
if (!validDate(f.entryDate,"Entry Date",true))
if (!validInt(f.cedPolNo,"Ced Pol no"))
if (!validRequired(f.policyType,"Policy Type"))
//validate Risk Nos.
thanks a lot its working now
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.