[Phplib-users] oohForm text element with multiple attribute
Brought to you by:
nhruby,
richardarcher
From: Andres B. Z. <aba...@ei...> - 2003-08-22 23:48:33
|
Hello: In Javascript, if multiple objects on the same form have the same NAME attribute (eg. <input type=text name=myField> ), an array of the given NAME (myField) is created automatically. Elements are indexed in source order starting at 0. So references to document.theForm.myField[0] are valid. Now, I am using this piece of php code: for ($i=0;$i<$n;$i++) { $f->add_element(array("type"=>"text", "name"=>"myField", "multiple"=>1, "value"=>"$nombre")); } And I have found that oohform prints the form elements as: <input name=myField[] value=''> The "[]" appended to the element name fools the javascript interpreter so I cant make reference to the elements. How can I make oohform to print the element name without the "[]" ? Thanks Andres |