8/17/2025 2:30:30 PM
|
|
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.
|
|
|
|
Adding Javascript onChange event to SLX Email, SLX Name and SLX Picklist Controls
Posted: 19 Feb 09 7:27 AM
|
Hi,
Does anybody know how to programmatically (in server side code) add Javascript onchange events to these controls? Usually (if its a textbox for example) you can just do:
myTextBox.Attributes.Add("onchange","myJSFunction()");
However, this doesnt work for the SLX custom controls. I have tried something like:
(txtAccEmail.Controls[0] as TextBox).Attributes.Add("onchange", "ValidateEmailField(this)");
To get the first Control in the Email Control (which would be the textbox part), cast it as a Textbox so I can get the Attributes.Add method, but there is no change event on the control when the page gets rendered.
I have tried also doing a ScriptManager.RegisterStartupScript on the page postback to add javascript to the page to find the controls and attach the events. This works, but seems to break other Ajax stuff in the client, as my page no longer renders correctly (all the controls are pushed over to the left). When I click on a menu item, such as New..., the screen will then sort itself out, so it must fire those events that I am somehow messing up.
Any ideas??
I know I can do validation on Postback events, but I want to do as much client side as possible. This is the Add/Contact account screen so for the functionality I require we are talking at least 12 postbacks to the server, before the user can even click Save. This just slows the page down so much when compared to how I had it in 6.2.
Thanks,
Nick |
|
|
| |
|
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!
|
|
|
|
|
|
|
|