.net Control id and javascript problem

  • Thread starter Thread starter sarunnio
  • Start date Start date
S

sarunnio

Hi,

I 've tried to work around with this long times ago.
I have a template and the page loaded inside.
When loading the page,the control ID contained with the page
will be automatically generated by ASP.NET as shown below

<input name="_PageTemplate:BodyPlaceHolder:txtEndDate"
id="_PageTemplate_BodyPlaceHolder_txtEndDate" type="hidden" value="15
May 2005 23:59:59" />

How could I use javascript to grab data from each control.
I can't access it through "document.form.txtEndDate.value"
Because, It said txtEndDate is undefined.

Any idea would be appreciated!

Regards
 
Hi,

You can loop thru the document element list and find for the control you
want to work with. Like here you can check whether you have the element name
ending with txtEndDate. A bit of js string manipulation is required.

Hope this helps.

Ganesh
 
Back
Top