dkhanna01 Posted October 13, 2009 Share Posted October 13, 2009 I have a form which says: <form enctype='multipart/form-data' method='post' action='process.php' target='_blank'> I need to call process.php on submit or on clicking submit button. Now this process.php is opening in another page because of _blank which is what I wanted. This is working absolutely fine, now i want this form to refresh / reload plus call process.php in new page, how can i make this work . Thanks Link to comment https://forums.phpfreaks.com/topic/177591-php-multiple-action-on-submit/ Share on other sites More sharing options...
mikesta707 Posted October 13, 2009 Share Posted October 13, 2009 you could use javascript to call a function that would submit the form in a new window, and refresh the page, and call that function onSubmit Link to comment https://forums.phpfreaks.com/topic/177591-php-multiple-action-on-submit/#findComment-936384 Share on other sites More sharing options...
dkhanna01 Posted October 13, 2009 Author Share Posted October 13, 2009 I'm trying: <form enctype='multipart/form-data' method='post' action='' target='_blank' onSubmit="MultipleFormAction()"> and my javascript MultipleFormAction is: <script type="text/javascript"> function MultipleFormAction() { alert("Test"); var selectedOne = document.forms[0].FunctionType.length; for (var i = 0; i < selectedOne; i++) if (document.forms[0].FunctionType.options.selected) var jsFunctionType = document.forms[0].FunctionType.options.text; var selectedOne = document.forms[0].RepoType.length; for (var i = 0; i < selectedOne; i++) if (document.forms[0].RepoType.checked) var jsRepoType = document.forms[0].RepoType.value; var jsBranchName = gettxtbranch.value; var jstxtOutput = document.forms[0].txtOutput.value; location.href="process.php?BranchName="+jsBranchName+"&FunctionType="+jsFunctionType+"&txtOutput="+jstxtOutput+"&RepoType="+jsRepoType; } </script> but calling location.href is not helping me Link to comment https://forums.phpfreaks.com/topic/177591-php-multiple-action-on-submit/#findComment-936388 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.