SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2002
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cloning Bill-To form data for Ship-To

    I've searched through several books, checked some code repositories, but haven't found what I see on websites quite frequently. Maybe I don't know what to look for by name?

    Simply, on a form which has "Bill-To" customer info, how to clone (or copy) the same data to a "Ship-To" column on the same form before processing.

    I tried one JavaScript thing but it just didn't work out well.

    Thanks for any info about this (preferably a PHP function, etc.) and where to find it.

  2. #2
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you mean copy the data from 1 form field to another before or as the user submits the form then Javascript is what you want, PHP will not do the job because it is a server side script that runs as part of a page request, where as you need client side processing to copy data between forms.

    Try putting something like

    Code:
    onblur="this.form.<OtherInputItemName>.value=this.value"
    in the input that you wish to copy the data from.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •