1. Hugh (cheesegrits) here. Thank you for all the good wishes. My back surgery was a success, post-op recovery is going well, and I'm getting stronger and feeling better every day. I hope to be getting back in the saddle and working support again over the next few days.
  2. IMPORTANT NOTE - we have made some changes in our github branch naming. The 'master' branch no longer exists, and is now called 'joomla25' (which is Fabrik 3.0). The 'joomla3' branch (which is Fabrik 3.2) remains unchanged. We have also removed all the other testing branches which had accuulated over the last few years. I have posted a thread in the Community forum for 3.0 with some more information, feel free to as questions there.

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 Member

    Level: Community
    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 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 Member

    Level: Community
    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