This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Include session variable as value for hidden input field


  1. rassoomach
    Member

    Hi,

    As it's been two years since this topic appears to have been dealt with:

    http://www.appnitro.com/forums/topic/enable-code-in-admin-only-fields?replies=10

    Can you please let me know if this fix should still apply? I've been trying for ages without any joy.

    thanks!

    Posted 15 years ago #
  2. redityo

    You still can apply the method in that post. However, you can follow to these steps to make sure you got the correct line

    1. Edit your view-functions.php file and go to around line 39 for these code

    //check for populated value, if exist, use it instead default_value
    if(isset($element->populated_value['element_'.$element->id]['default_value'])){
    	$element->default_value = $element->populated_value['element_'.$element->id]['default_value'];
    }

    then put these code exactly bellow that code

    if(($_REQUEST['id'] == 2) && ($element->id == 1)){
    	$element->default_value = $_SESSION['your_session_var'];
    }

    that would fill text field with id 1 on form 2 a session variable value. Don't forget to change the id's with yours.

    2. Edit your CSS form and put this code in there :

    #li_1 {
    display:none !important;
    }

    that would hide your text field.


    MachForm Support

    Posted 15 years ago #
  3. AKirob
    Member

    This doesn't seem to work?1 :(

    Posted 14 years ago #
  4. yuniar

    We've replied to your support request email. Please check it there.


    MachForm Founder

    Posted 14 years ago #

RSS feed for this topic

Reply