How to find a dynamically-generated HTML element?

Create a list of some sort on the server side to keep track of control id's when you render the page for whatever reason, write those id's out in a script block (put them in an array or whatever) when you need to submit your values, you can use the javascript array contents to reference the controls you might have to do a little more work to find your actual values. For ingragistics' fancy-pants controls they provide a special method to get information about the "control" as a whole. Rad controls might have something similar.

Create a list of some sort on the server side to keep track of control id's when you render the page for whatever reason, write those id's out in a script block (put them in an array or whatever) when you need to submit your values, you can use the javascript array contents to reference the controls. You might have to do a little more work to find your actual values. For ingragistics' fancy-pants controls they provide a special method to get information about the "control" as a whole.

Rad controls might have something similar.

Bullets 1 & 2 won't work because the control ID's of the RadComboBoxes aren't generated at runtime -- they're generated from some GridDropDownListColumnEditor objects once my RadGrid enters edit mode. Bullet 3 might work, however even after using FireBug I don't know exactly which of three tags is storing my needed value (RadComoBox in my case appears to generate three HTML tags, none of which appear to store a value when I try to return it with jQuery). – KSwift87 Jul 22 '10 at 19:56 I appreciate your response, but I think I've actually come up with an answer after looking at all my JavaScript again (not really eloquent, but reliable).

I'll post it after it's been tested. – KSwift87 Jul 22 '10 at 19:57 Turns out my answer is not working like I'd hoped... The search for an answer continues (tomorrow)! – KSwift87 Jul 22 '10 at 20:05.

Okay so the answer I ended-up coming up with isn't really eloquent, but it's 100% reliable and all on the client-side (which is good because my company has IE7 as its standard web browser x_x). I was able to get rid of a bunch of $find commands and if-statements because I no longer have to search for the specific HTML ids. Function SelectedIndexChanged(sender,eventArgs) { var rcbID = sender.

Get_id(); var LocID = rcbID. Substring(0,37) + "Locale"; pastCombo = currentCombo; currentCombo = eventArgs. Get_item().

Get_text(); if(editedRow! = null) { var Location = $find(LocID); Since the ids weren't being generated server-side (as far as I could tell, although admittedly I didn't try Roatin's solution because I had thought of mine before I saw his answer + mine seemed simpler since I'm already doing a bunch of stuff client-side inside JavaScript), I looked around to see what I was already getting, and realized that var rcbID = sender. Get_id(); was already getting me an extremely similar value to what I was already looking for (only instead of it saying SunLocale, it said SunActivity).

So I figured hey, I can substring() out everything in rcbID and then append "Locale" to it, and then run a $find() command on that in order to get me the proper RadComboBox. Turns out it works. Anyway though I do thank you guys for looking into my problem even though I ended-up finding my own solution.

:-).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions