Forum  Commercial Foru...  Commercial Foru...  javascript to disable controls
Previous Previous
 
Next Next
New Post 12/13/2011 3:31 AM
  dubem1
1077 posts
1st Level Poster




javascript to disable controls 
Modified By dubem1  on 12/13/2011 8:48:50 AM)

Hello,

I have two checkboxes, when the first one is not checked, the second one cannot be checked so it has to be disabled and turn enabled when the first checkbox is checked (and turn disabled and not checked if the first checkbox is unchecked) .

Without VWG, this would be done by a simple javascript code and would be very effective since no server call would be necessary.

So my question is : can I add client side code execution in a VWG application instead of calling the server and re-render part of the page?

thanks

Martin

 
New Post 12/13/2011 10:52 AM
  palli
14324 posts
1st Level Poster




Re: javascript to disable controls 

Hi Martin,

Sure you can, with a little JavaScript digging.

The question is if it is really worth it, and if you will really get the results you are looking for.

First, as you probably know, the rerendering of the form is minimal if you simply change one control. Secondly, I doubt that you will get away with no request sent to the server, because if you need to status of the control to be updated to the server side, you will need to issue a request anyway.

In order to get some JavaScript invoked, you can for instance use:

 

            this.checkBox1.RegisterClientAction("alert","hello");

Hope this helps,

Palli

 

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  Commercial Foru...  Commercial Foru...  javascript to disable controls
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS