Appnitro Software Forums » MachForm 2

please, I need this...


  1. carlosblancomendoza
    Member

    I have my form with several single line tex, but i need to Know How can i do to create a password form?

    Posted 3 years ago #
  2. redityo

    Do you want to create "single line text" with password type ? if it's so, you need to edit "includes/view-functions.php" go to around line 40~47, you will see this code :

    $element_markup = <<<EOT
    		<li id="li_{$element->id}" {$error_class}>
    		<label class="description" for="element_{$element->id}">{$element->title} {$span_required}</label>
    		<div>
    			<input id="element_{$element->id}" name="element_{$element->id}" class="element text {$element->size}" type="text" value="{$element->default_value}" />
    		</div>{$guidelines} {$error_message}
    		</li>
    EOT;

    replace with this

    if ($_GET['id'] == '31' && $element->id == '1')  {
    	$set_type = 'type="password"';
    } else {
    	$set_type = 'type="text"';
    }
    
    $element_markup = <<<EOT
    		<li id="li_{$element->id}" {$error_class}>
    		<label class="description" for="element_{$element->id}">{$element->title} {$span_required}</label>
    		<div>
    			<input id="element_{$element->id}" name="element_{$element->id}" class="element text {$element->size}" {$set_type} value="{$element->default_value}" />
    		</div>{$guidelines} {$error_message}
    		</li>
    EOT;

    I assume you want to change text box with element id = 1 in form id 31 to be password type. make sure you adjust those ID with yours


    MachForm Support

    Posted 3 years ago #
  3. carlosblancomendoza
    Member

    Excellent. Your technical advice was correct at 100%.

    Posted 3 years ago #

RSS feed for this topic

Reply