Click here to Skip to main content
13,834,141 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi Friends,
I have one aspx page and html page..Here I am copying one form from my html page as below...Since this form is calling php...The validations are not getting applied in my aspx page While the validation on submit is wrkng fine in html..Dont know how to proceed please help..
<form action="LegalBay.php" method="post" name="LegalBayform" onSubmit="return LegalBay();">
Updated 2-Oct-12 23:54pm
Achha Insan 3-Oct-12 5:32am
nothing is impossible. you can do it.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Are you using client validation or server validation?

With server validation, the content is checked when the page is posted back. Where your action is to a different page, there's no opportunity to execute the server side validation.

ASP.Net 3 onwards supports "Client-Side Validation". This loads validation scripts into the web page which are executed in the client without posting back. The following is the MSDN article on client validation.[^]

A work around would be to post back to your page so you can validate the form. Then render a redirect page such as this:

  <body onload="document.forms[0].submit();">
    <form action="LegayBay.php" method="post">
      <input type="hidden" name="field1" value="value1" />
      <input type="hidden" name="field2" value="value2" />
Radhika Vyas 4-Oct-12 2:56am
Hi..My validation function is in one of my js files.. I included it in my aspx page..
<script type='text/javascript' src='jsfiles/functions.js'></script>
My form is working fine in another aspx page index.aspx...Dnt know for this aspx its not working...
Stephen Hewison 4-Oct-12 3:48am
In most browsers pressing F12 will launch the developer tools. You can then use the script section to set a break point in your JS code. You can then step through your JS code to see where it's failing.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hey I got solution....Actually the problem is I have pasted that form inside another form so only it doesn't work...Now working fine...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190114.1 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100