Hello,
I have a form for gift cards that gathers the info for purchaser and recipient - but I realized that authorize.net is going to want to know the address that matches that of the credit card billing info. So I want to add a billing address to the form - but instead of just have the fields and a js to copy from the "Purchaser" I was hoping to let the user click on a link if he needed to set the billing address - other wise the purchasers address would be used for the billing address.
Problem #1;
How do I copy the $_POST['fromaddress'] to $_POST['billingaddress'] if nothing is clicked?
Problem #2;
I wanted to hide the billing address table and only reveal it when the link was clicked. I tried this code:
in the form HTML
and this
in the javascript section.
On a regular html page this works fine but for some reason in my Chrono form it does not respond??
I tried putting the js at the end of my index.php - but that didn't work either?
Any ideas?
thanks,
ps. love the new look!
I have a form for gift cards that gathers the info for purchaser and recipient - but I realized that authorize.net is going to want to know the address that matches that of the credit card billing info. So I want to add a billing address to the form - but instead of just have the fields and a js to copy from the "Purchaser" I was hoping to let the user click on a link if he needed to set the billing address - other wise the purchasers address would be used for the billing address.
Problem #1;
How do I copy the $_POST['fromaddress'] to $_POST['billingaddress'] if nothing is clicked?
Problem #2;
I wanted to hide the billing address table and only reveal it when the link was clicked. I tried this code:
<p><a href="#" onclick="show('bill');" name="top">Click here</a> (if billing address is different)</p>
<div id="bill" style="display:none">
<table align="center" width="450" cellpadding="3" name="bill2" id="bill2">
<tr class="rowTitle">
<td colspan="2"><center>
<b>Billing address:</b>
(if different)
</center></td>
</tr>
<tr>
<td >Address:<font color="#ff0000">*</font> </td>
<td ><input name="billaddress" type="text" value="<?php if(isset($_POST['billaddress'])) echo $_POST['billaddress'];?>" size="35" <?php echo $readonly;?> class="required"></td>
</tr>...
in the form HTML
and this
function show(ele) {
var srcElement = document.getElementById(ele);
if(srcElement != null) {
if(srcElement.style.display == "block") {
srcElement.style.display= 'none';
}
else {
srcElement.style.display='block';
}
}
//return false;
}
in the javascript section.
On a regular html page this works fine but for some reason in my Chrono form it does not respond??
I tried putting the js at the end of my index.php - but that didn't work either?
Any ideas?
thanks,
ps. love the new look!
Hi samoht,
p1# add this at the onsubmit before email code section!
p2# this should work yes if you added the code in the js section, not sure why it doesnt!
Cheers
Max
p1# add this at the onsubmit before email code section!
p2# this should work yes if you added the code in the js section, not sure why it doesnt!
Cheers
Max
Hello admin,
you can look at the form here
http://new.diecispa.com/giftcard-form.html
did you mean to insert some code??
you can look at the form here
http://new.diecispa.com/giftcard-form.html
did you mean to insert some code??
p1# add this at the onsubmit before email code section!
What I mean is that you will equal the POST variables at the onsubmit before email so when it reaches the plugin processing point, both of them will have the same values 🙂
Cheers
Max
Cheers
Max
ya yes,
Regarding the js problem - do you think that could be SEF url's related?
Regarding the js problem - do you think that could be SEF url's related?
Not sure, you need to test, for me the logic looks fine, JS needs heavy testing/debugging with firebug when its not working for some unknown reason like this 😀
funny thing is firebug doesn't through any errors?
I thought maybe it was a conflict with the mootools or prototype - but that should cause firebug to show me an error.
I guess for now I'll just have to show the billing form and leave a note that says if you leave the fields blank the previous address will be used for your billing address. I just hate how long this form is getting.
Thanks for the help!
I thought maybe it was a conflict with the mootools or prototype - but that should cause firebug to show me an error.
I guess for now I'll just have to show the billing form and leave a note that says if you leave the fields blank the previous address will be used for your billing address. I just hate how long this form is getting.
Thanks for the help!
Ok, If I were you I would minimize the JS code and add it to the JS box and test the link again until I know where the error is, I'm sure its something very simple you are missing!
Cheers
Max
Cheers
Max
This topic is locked and no more replies can be posted.