anand.arjunan Posted December 7, 2006 Share Posted December 7, 2006 Hi all in my project i am using button value "Update/Print"i am click the button that time i need the informations are updated at the same time i want to open the new browser window that print or pdf formet it will open the parent window there display updated successfully so the parent window reloaded.that process is working but i dont know how to open the individual window is pdf file. Link to comment Share on other sites More sharing options...
justsomeguy Posted December 7, 2006 Share Posted December 7, 2006 You will probably want to use Javascript to open the new window. If everything is correct when they submit the form, then output some javascript to open the PDF in a new window. <script type="text/javascript">window.open("http://path/to/pdf", "_blank", "width=800,height=600");</script> Link to comment Share on other sites More sharing options...
anand.arjunan Posted December 8, 2006 Author Share Posted December 8, 2006 You will probably want to use Javascript to open the new window. If everything is correct when they submit the form, then output some javascript to open the PDF in a new window.<script type="text/javascript">window.open("http://path/to/pdf", "_blank", "width=800,height=600");</script> ya it will open new window but the parent window also reloaded is must because all the fields are updated and there echo the updated successfully message also display.how it is possible Link to comment Share on other sites More sharing options...
jesh Posted December 8, 2006 Share Posted December 8, 2006 ya it will open new window but the parent window also reloaded is must because all the fields are updated and there echo the updated successfully message also display.how it is possibleYou might put that window opening script in a onsubmit handler. Something like this:<script type="text/javascript">function validate(formobj){ var isValid = false; // do whatever you need to do to make sure you // want the user to be able to submit the form // (e.g. all the required fields have data) // let's assume everything validates: isValid = true; if(isValid) { // window.open code can go here. this will make // it so that the window only opens when the form // is actually submitted. } // if you return false here, the form won't be submitted. // if you return true here, the form will be submitted. return isValid;}</script><form method="post" action="thePostPage.php" onsubmit="return validate(this);"></form> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now