<form id="myFlashForm" > <input type="text" name="field1" eform="Field One:text:1:Some custom error message" /> <input type="text" name="field2" eform="Field Two:date:1:Another custom error message" /> <etcetera ...> </form>
//<?php
# invoke OnBeforeFormMerge event set by another script
if ($eFormOnBeforeFormMerge) {
if( $isDebug && !function_exists($eFormOnBeforeFormMerge))
$fields['debug'] .= "eFormOnBeforeFormMerge event: Could not find the function " . $eFormOnBeforeFormMerge;
else
if ($eFormOnBeforeFormMerge($fields)===false) return;
}
//?>
//<?php
# invoke OnBeforeFormMerge event set by another script
if ($eFormOnBeforeFormMerge) {
if( $isDebug && !function_exists($eFormOnBeforeFormMerge))
$fields['debug'] .= "eFormOnBeforeFormMerge event: Could not find the function " . $eFormOnBeforeFormMerge;
else
//the change is in the following line...
if ($eFormOnBeforeFormMerge($fields, $tpl )===false) return;
}
//?>
[+validationmessage+] <object ...> <param src="flashForm.swf" /> <param ... /> <... etcetera /> </object>
//<?php
function formMergeEvent( &$fields, &$tpl ){ //both params as reference
//load the extra chunk in place of $tpl
$tmp = efLoadTemplate('flashFormChunk');
if($tmp) $tpl = $tmp;
else die("Could not load the 'flashFormChunk'");
return true
}
//?>
[[myEventFunction]] [!eForm? &eFormOnBeforeFormMerge=`formMergeEvent` &formid=`myFlashForm` !]
<select name="title" id="title">
<option value="">select title</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
</select>title » Incorrect value
This discussion is closed to further replies. Keep calm and carry on.