We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6965
    • 15 Posts
    Hi folks,

    Tearing my hair out a little here.

    I'm trying to populate the VALUE of input fields within an eForm form with values taken from the URL.

    Whatever I try .. the field remains blank. Below is a summary of how things are currently.

    Any help HUGELY appreciated!

    Cheers.

    The URL looks something like this:

    .../index.php?id=139&propertyID=5678

    On the page itself I have the following:

    [!GetPropertyID!]
    
    [!eForm? &eFormOnBeforeFormParse=`eformGetPropertyID`  &formid=`CBLbidForm` &subject=`CBL Property Bid Response` &to=`***@****.co.uk` &ccsender=`0` &tpl=`CBLbidForm` &report=`CBLbidFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`138` !]


    The snippet GetPropertyID looks like this:

    <?php
    if( !function_exists('eformGetPropertyID') ) {
    function eformGetPropertyID(&$fields,&$templates){
    global $modx;
    $propertyID = strip_tags($_GET['propertyID']);
    $templates['tpl']=str_replace('[+display_propertyID+]',$code,$templates['tpl']);
    return true; } }
    return '';
    ?>


    and within the form template chunk (CBLbidForm) - the relevant input field is as follows:

    <input type="hidden" name="CBLpropertyID" id="CBLpropertyID"  value="[+display_propertyID+]" />


    finally, the form report chunk (CBLbidFormReport) is as follows:

    <p>This is a response sent using the ******* Website. The details of the bid follow below:</p>
    
    <p>The user **** has bid for the property  [+CBLpropertyID+] </p>