2/22/2025 9:00:18 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
Javascript Error
Posted: 19 Mar 08 8:18 AM
|
I am trying to check for the visibility of a panel on a 7.2.2 smart part. In the javascript I am trying to access the properties of the panel with the following code:
var vPanel=document.getElementById("ctl00_MainContent_TicketODMCertApplication1_pnlMktIC").value; if ((vPanel.style.display == 'none') || (vPanel.style.visibility == 'hidden')) do more stuff...
The error [Microsoft JScript runtime error: Object required] occurs on the first line above. I have tried both the ID I gave the panel, pnlMktIC, and the ID from the rendered source code, ctl00_MainContent_TicketODMCertApplication1_pnlMktIC. I also tried with and without the '.value' on the end. I get errors with both. Any Javascript experts out there? Thanks |
|
|
|
Re: Javascript Error
Posted: 19 Mar 08 11:19 AM
|
First of all, you're looking for the panel and attempting to look at it's style, but you set the vPanel variable to the panel's value attribute, not the panel itself (drop the ".value" off the end).
What the error is indicating is that element you're looking for is not found and so you're getting a null reference back. You immediately try to access the value attribute, but since you have a null reference you get an object required error.
It is most likely that your element name is wrong. Besides that can change due to changes on the form as well. What I ususally do is add server tags into the Javascript to read the controls ClientID property.
Something like this (you'll have to play with where it makes sense to do this and how to get this to work for your scenario - but this should give you an example)
var vPanel=document.getElementById("<% pnlMktIC.ClientID %>"); if ((vPanel.style.display == 'none') || (vPanel.style.visibility == 'hidden')) //do more stuff...
This way the element ID is determined at runtime. Make sense?
-Ryan |
|
|
|
Re: Javascript Error
Posted: 19 Mar 08 1:08 PM
|
Thanks Ryan, i actually decided to add hidden text boxes to track the visiblity of the panels. This seemed to work. Here is the syntax that worked:
if (document.getElementById('ctl00_MainContent_TicketODMCertApplication1_txtpnlMktICState').value == 'hidden') { ValidatorEnable(ctl00_MainContent_TicketODMCertApplication1_MarketingContactNameRFV,false); }
This actually headed off another problem with panels set to hidden at runtime not rendering in html.
I have another question.. I am trying to validate some SLX Date Picker controls, but the required field validator seems to crap out on these fields.. Is it possible to validate the slx date picker control with asp.net validation controls? Thanks |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|