If you're using HTML4, then it's based on the name, but if you're using
XHTML1 then it's based on the ID.
Why can't you use the existing IDs?
// javascript
var element = document.getElementById('username');
// css
input#username{ color: #0c0; }
--
Hector
On Tue, Feb 16, 2010 at 11:23 PM, mathieu.suen
<[email protected]>wrote:
> Hector Virgen wrote:
>
>> The ID is based on the name of the element. If your element it named
>> "lock" the ID will be "lock", or if using subforms, will be
>> "{subform}-lock".
>>
>> If you mess with the ID's, Zend_Form won't know how to handle the posted
>> data because browsers post data based on the IDs of the inputs.
>>
>
> No, that's base on the name not the IDS
>
>
>
>> Why do you need to change the ID?
>>
>
> Javascript, css stuff.
>
>
>> --
>> Hector
>>
>>
>>
>> On Tue, Feb 16, 2010 at 12:31 AM, mathieu.suen <
>> [email protected] <mailto:[email protected]>> wrote:
>>
>> Саша Стаменковић wrote:
>>
>> Chage
>>
>> $mySubForm->getElement('lock')->setAttribs('id', 'lock' .
>> $server->getUniqueId());
>>
>> to
>>
>> $mySubForm->getElement('lock')->setAttrib('id', 'lock' .
>> $server->getUniqueId());
>>
>>
>> Actually I mean setAttrib. The issue still remain.
>> The more I dig in the code the more I get made at it.
>>
>> Adding design patter is a good things but in that situation it is
>> harmful.
>>
>>
>> Regards,
>> Saša Stamenković
>>
>>
>>
>> On Tue, Feb 16, 2010 at 9:06 AM, mathieu.suen
>> <[email protected]
>> <mailto:[email protected]>
>> <mailto:[email protected]
>> <mailto:[email protected]>>> wrote:
>>
>> Hi,
>>
>> How do you setup the id of form element?
>> I try this:
>>
>> $mySubForm->getElement('lock')->id = 'lock' .
>> $server->getUniqueId();
>>
>> and also:
>>
>> $mySubForm->getElement('lock')->setAttribs('id', 'lock' .
>> $server->getUniqueId());
>>
>> But non of the above work.
>>
>> It always yield something like : subForm-myuniqueid-load
>>
>> Then I decide to look at the code and found out that is
>> completely
>> odd and really not well design IMHO.
>>
>> So if you have any idea thanks
>>
>> --Mathieu Suen
>>
>>
>>
>>
>>
>>
>> -- Mathieu Suen
>>
>>
>>
>>
> --Mathieu Suen
>
>
>
>