Jump to content

php multiple action on submit


dkhanna01

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.