1. Fabrik 3.5.2 is now available to download. Read the blog for highlights about this release.

    As always, please back up your site prior to updating and if possible test in a dev environment first.

    Also, our 3.5.1 package file was hacked, the effected dates were 1/15/2017 - 1/17/2017. If during those days you downloaded the 3.5.1 package file from the JED or our site download page, please re-install the package with a fresh copy or upgrade to Fabrik 3.5.2. Github downloads were not effected.

Javascript to copy the values into a form

Discussion in 'Professional Support' started by paolo.tateo, Sep 1, 2009.

Thread Status:
Not open for further replies.
  1. paolo.tateo

    paolo.tateo Member

    Level: Professional
    My need is this:
    in the table of contacts {suss_contatti} are some fields to define "residence" of people (town, zip code, address, etc ...) and similar fields to define the "domicile" (town, zip code, address, etc. ...).

    Very often, but not always, residence and domicile are the same.

    I would do ensure that people fill out the form can (if you need it) click on a button element, that will copy all the fields in residence in the analogous fields in domicile.

    For example, the button will copy the values in in {suss_contatti___residenzaindirizzo} to {suss_contatti___domicilioindirizzo} and also (note: that this is a joint!) {suss_contatti___residenzacomune} to {suss_contatti___domiciliocomune}

    How can I do this?

    Thanks in advance
     
  2. peamak

    peamak Moderator

    Level: Community
    You can ad a 'button' element and add a javascript on it:
    on: Click
    Code:
    Code (Text):
    $('suss_contatti___domicilioindirizzo').value = $('suss_contatti___residenzaindirizzo').getValue();
    Should do it.
     
    3 people like this.
  3. paolo.tateo

    paolo.tateo Member

    Level: Professional
    Thanks peamak!

    This is my JavaScript that work fine !

    $('suss_contatti___domicilioindirizzo').value = $('suss_contatti___residenzaindirizzo').getValue();
    $('suss_contatti___domiciliocivico').value = $('suss_contatti___residenzacivico').getValue();
    $('suss_contatti___domicilioindirizzo2').value = $('suss_contatti___residenzaindirizzo2').getValue();
    $('suss_contatti___domiciliocap').value = $('suss_contatti___residenzacap').getValue();
    $('suss_contatti___domicilioprovincia').value = $('suss_contatti___residenzaprovincia').getValue();
    $('suss_contatti___domiciliocomune').value = $('suss_contatti___residenzacomune').getValue();

    Many thanks
    Paolo
     
Thread Status:
Not open for further replies.

Share This Page