I Have some form with html like this:
[tt]...
<label for="categ">Needed category</label>
<p><select name="categ" id="categ" eform="Category::1" onchange="verify()">
<option value="Select" selected="selected">Select...</option>
<option value="Beginner level">Beginner level</option>
<option value="Advanced level">Advanced level</option>
</select></p>
<div id="divForSelect" style="display:none">
<label for="course">Select course</label>
<select name="course" id="course" eform="Course::1"><option value="Default" selected="selected">Default</option></select>
</div>
...[/tt]
And i have a jQuery code:
[tt]function verify(){
var o = $("#categ").attr("selectedIndex");
if(o==1){
$("select#course").append($(’<option/>’).val("B").html("B"));
$("select#course").append($(’<option/>’).val("C").html("C"));
$("select#course").append($(’<option/>’).val("D").html("D"));
$(’#divForSelect’).css("display","block")
}[/tt]
Creating new options working correctly in firebug, but dynamically created options do not send, eform reports "wrong value", but "Default" and other pre-coded values sended correctly.
Why?
Sorry for bad english
Автор благодарит алфавит за любезно предоставленные буквы
All I can say is that the eForm gets the valid options from the chunk. It doesn’t process any snippet, chunk, etc. when getting the valid options for the select box from the chunk. So what happens is eForm looks at the chunk, then the chunk gets processed.
So maybe in order to have options appear and dissappear that will validate with eForm, you’ll need to code the other options into your chunk and then hide them somehow.
You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx.
Carpet Cleaning