Jump to content


Photo

Checkbox Autofill


  • Please log in to reply
2 replies to this topic

#1 cjbeck71081

cjbeck71081
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 31 August 2006 - 09:48 PM

I am trying to code address information, where Owner name and Company name may be different or they may be the same.  In the instance they are the same i would like to use an HTML checkbox, that when checked would auto populate the "OWNER" side of the form, by what the "COMPANY side of the form has.
Not even sure if its possible, might be the same as if "Shipping" and "Billing" information is the same perhaps that is using Javascript.

Thanks in advance
Chris

#2 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 31 August 2006 - 10:12 PM

yes u are right it's Javascript, I'am using that kind of code, if checkbox is checked it remembers the inputed value
I don't need your script, I'll try to write it myself

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 31 August 2006 - 11:52 PM

If you want to populate the billing address with shipping address when the user clicks the box then you need javascript.

If you just want to indicate they are the same then it's php.
if (isset($_POST['cb_sameaddress'])) {
     $billing = $shipping;
}

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users