noob javascript refernce input array question

all the forms generated by yii create input names as array




<input name="Product[PostedDate]" id="Product_PostedDate">

<input name="Product[SortOrder]" id="Product_SortOrder">

<input name="Product[Title]" id="Product_Title">



I need pass some of the text field to javascript like this

<img src="xx" onclick="doSomething(document.form.Product[PostedDate])">

but it is not working. How do I reference the fields in array?

uses the id:




<img src="xx" onclick="doSomething(document.getElementById('<?php echo CHtml::activeId($model, 'PostedDate') ?>'))">



The function CHtml::activeId($model, ‘PostedDate’) will return Product_PostedDate.

If you want to use Jquery syintax:




<img src="xx" onclick="doSomething($('#<?php echo CHtml::activeId($model, 'PostedDate') ?>'))">



Thanks zaccaria!