Need a billing address for authorize.net

samoht 25 Jul, 2008
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:
	<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!
Max_admin 25 Jul, 2008
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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 26 Jul, 2008
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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
samoht 26 Jul, 2008
ya yes,

Regarding the js problem - do you think that could be SEF url's related?
Max_admin 26 Jul, 2008
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 😀
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
samoht 26 Jul, 2008
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!
Max_admin 26 Jul, 2008
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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger