Moonsoft Software Solutions

Hide fields on Calculate

Started 1 Aug 2012 · 2 replies

  1. _MSTeam#
    Hello,

    I have one question, hopefully you have faced this before. Is it at all possible, for when the user clicks the calculate button, the form layout hides as the exit layout shows, and when the reset button is clicked, the form layout is displayed again?

    kind Regards,
  2. _MSTeam#
    Hello,

    You can doit adding this code to 'Javascript events' in your Calcbuilder admin:

    //DO NOT MODIFY THIS LINE, IS NEEDED TO HANDLE PROPER CALCULATOR INSTANCE
    seed=$('cb_layout_wrapper').getParent().getProperty('id').substr(0,$('cb_layout_wrapper').getParent().getProperty('id').indexOf("_"));

    // Event on Calculate Button
    $(seed+'_calculate').addEvent('click',function(){
    // Hide fields
    $(seed+'_cb_form').getElement('.cb_layout_wrapper').hide();
    // Hide calculate button
    $(seed+'_calculate').hide();
    });

    // Event on Reset Button
    $(seed+'_calc_adminForm').getElement('input').addEvent('click',function(){
    // Show fields
    $(seed+'_cb_form').getElement('.cb_layout_wrapper').show();
    // Show Calculate button
    $(seed+'_calculate').show();
    // Hide results
    $(seed+'_cb_result').hide();
    });



    This code is made with Calcbuilder 2.0.2 and Joomla 2.5.6. This code is commented to help you to get only features you needed.

    Hope this helps. Regards,

    Moonsoft Team
  3. Moonsoft support
    Thanks, that works perfectly.

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket