Page 1 of 1

PHP inserted code

Posted: Sun Jan 31, 2010 1:15 pm
by mjhaston
I have a page that has some of the code generated for me. Running the following code will generate a bunch of hidden fields incuding an amount field and then some signatures that are based on that amount.

In a nutshell I want to call InsertSignature with the value from my amount2 input field before the submit button is clicked. Like onChange possibly.

Code: Select all

 
<?php InsertSignature("10.00", "usd") ?>
 

I could have a page for the input of the amount which would then call another page to generate the hidden fields and then that would go to a page with the credit card information. I'd rather not have the user go through so many pages.

My goal is to have a page with an amount input field and submit button. I would need to capture the amount field onChange and call the InsertSignature function returning all of the hidden variables.

Do I need to use some type of Ajax.Updater() to accomplish this? Can I do it all with PHP or do I need JavaScript since the amount is not yet POSTed?

Thanks in advance.



Here's the test code I was provided:

Code: Select all

 
 
<?php include ("hop.php")?>
 
<html>
<body>
<h1>sample_product_name</h1>
<p>Here, you enter the description of your product.</p>
 
<form action="https://xxxxxxxx/hop/orderform.jsp"
    method="get">
<?php 
    InsertSignature( "99.00", "usd" );
?>
 
 <input type="text" name="amount2" />
 <input type="hidden" name="orderPage_transactionType" value="authorization" /> 
 <input type="submit" name="submit" value="Make a Payment" />
 
</form>
</body>
</html>
 

Re: PHP inserted code

Posted: Thu Feb 04, 2010 5:43 am
by jaiswarvipin
You can use

1) Ajax whcih help you to call the all hidden vale form server without posting / refreshing you page
2) if alll hidden value are stored in the nay parent form ot child form the you can retrive using Javascript as well.