473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Accessing Form Elements through User Controls using AJAX

Hi guys,

I wondered if anyone could help me with this problem, or even shed some light on the direction I need to take to resolve it? I'm using .NET 2.0 (C# flavor) to build a large user-based website.

I've created an AJAX based user control, which is dynamically placed on a page (once, or multiple times) if the user has the correct permissions to receive it.

It contains two drop down lists - employee value and partner value; and a further date of birth selection user control which holds three additional drop down lists containing day, month and year.

I've managed to make the employee and partner value dropdowns dynamically update a value field via AJAX whenever the onchange event is called (again which has to be created dynamically as there can be multiple user controls on one page and I use ClientID to retreive the correct ID of the element). It passes the values of the five fields via a pipe delimited string list (eg: 500|10|2006|08|30) to the AJAX and it updates. Successfully, I'm pleased to add.

However, I'm having difficulty making the same onchange events of the date user control also update the value via AJAX. Despite passing the same code to use each of the date drop down lists, I receive an Javascript error telling me that the ID of the employee value (the first item called in the onchange event) does not exist. I can see it on the page, it is exactly the same event and calls the same name as the employee dropdown, yet it says it doesn't exist.

I think this error is something to do with how the date field in a separate User Control is unable to wire up to the Employee/Partner dropdown values to process the script, even though in Source mode the object exists. The Javascript error I'm receiving is:

Error: ctl00_cphContent_ctl00_ctl00_ddlEmployeeValue is not defined
Source file: http://computername/WebResource.axd?d=XRxrUjVsypu8znX1IiRn0yJ-T9vcwP8T9_KFWtOLGHQ1&t=632961828600156250
Line: 97

This line in WebResource is within 'function ValidatorHookupEvent(control, eventType, functionPrefix)'

Has anyone got any ideas, or explanation as to why this is happening?
Nov 7 '06 #1
1 2440
Don't mean to post again, but afraid I'll get lost among all those posts above me.

Is anyone able to shed any light on why this may be happening, even if they don't know the solution?
Nov 8 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
18
by: Choxio | last post by:
Using ASP you can access posted form elements. Is it possible to access them from JavaScript? myHTML.htm <form action=myASP.asp> <input type=hidden id=f1 value=val1> <input type=hidden...
6
by: Chris Styles | last post by:
Dear All, I've been using some code to verify form data quite happily, but i've recently changed the way my form is structured, and I can't get it to work now. Originally : The form is...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
2
by: Vivek Sharma | last post by:
Hi There, I have a situation where I wish to load the controls dynamically on the basis of user role. Hence, I am using this code. if (UserRole == "IS Administrator") { Control UC1 =...
6
by: Chuck Anderson | last post by:
My knowledge of JavaScript is limited. I learn from example and then adapt those examples to suit my needs. I have stumped myself on this one. I have a form with checkboxes that I want to...
3
by: judy.j.miller | last post by:
Does anyone know why i can't access a form element value using dot notation in firefox, when i'm in a function. Works ok in the body. I'm trying to do this: var FarTemp = faren.temp.value; I...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
3
by: ton | last post by:
Hi, I'm using AJAXPRO this works very well. What I want to do is to add new page elements at my web site without using a postback. And I do not mean listitems but a complete dialog. Let me...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.