function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vin_devvin_dev 

Auto form Submission using JavaScript did not pass the parameters to the redirected page

Hi All,

 

I have done the auto submission for html form which is inside in VF page.Below is my code ,

<apex:page>

<html>

<form method="POST" action="SamplePage" name="myForm" id="formone">

<input type="hidden" name="AMT" value="10"/>
<input type="hidden" name="ID" id="cust" value="2"/>
<input type="submit" value="Submit" id="bu" name="i"/>
</form>

<script>

document.getElementById("formone").submit();

</script>

 

</html>

</apex:page>

It automatically submited the form and redirected to "SamplePage".But does not carry the POST values to action page.

values has to passed as parameters to the redirected page.


Please help me to find a solution.

 

Thanks in advance