Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET PHP
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();">
Posted 2-Oct-12 22:52pm
Edited 2-Oct-12 22:54pm
v2
Comments
Achha Insan at 3-Oct-12 5:32am
   
nothing is impossible. you can do it.
Rate this: bad
good
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...
  Permalink  
Rate this: bad
good
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.
 
http://msdn.microsoft.com/en-us/library/yb52a4x0(v=vs.85).aspx[^]
 
A work around would be to post back to your asp.net page so you can validate the form. Then render a redirect page such as this:
 
<html>
  <head><title>Redirecting</title></head>
  <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" />
    </form>
  </body>
</html>
  Permalink  
Comments
Radhika Vyas at 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 at 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.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 470
1 mhegazy94 460
2 Ravi Bhavnani 190
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,135
1 OriginalGriff 6,801
2 CPallini 5,350
3 George Jonsson 3,619
4 Gihan Liyanage 2,797


Advertise | Privacy | Mobile
Web04 | 2.8.140922.1 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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