java
xml
python
mysql
linux
xcode
objective-c
visual-studio
eclipse
silverlight
html5
json
perl
algorithm
facebook
oracle
cocoa
mvc
postgresql
dom
**Check this way it will work as you expected** //main.php <html> <head> <script type="text/javascript"> function validateMain() { alert('main'); } function validateSub() { alert('sub'); } </script> </head> <body> <form id="main" onsubmit="return validateMain();"> <input type="text" name="first" id="first"/> <input type="submit" value="Submit Main"/> </form> <iframe name="ifr-form" id="ifr-form" src="test.html"></iframe> </body> </html> //test.html the second form included through iframe <!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div> <form id="sub" onclick="return window.top.validateSub();"> <input type="text" name="first" id="second"/> <input type="button" value="Submit Sub" /> </form> </div> </body> </html>
you must check if php and iframe are compatible, as far as i Know I don't think that frames and php gives any output, hope this helps.