Validate if grid add using clients side javascript

Validate if grid add using clients side javascript

Postby papirri3 » Tue Nov 17, 2015 8:44 am

I have used this validation on server side script using CurrentAction, but I can't find how to create a validation on client side,

I have some filters using javascript but it hides all field, I want to hide those fields only if current action is gridadd and show the field if it is just on list page.

thanks for your help--
papirri3
 
Posts: 42
Joined: Tue Sep 29, 2015 9:44 am

Re: Validate if grid add using clients side javascript

Postby ready4data » Tue Jul 19, 2016 6:32 pm

Here is what I do
Place in the startup script of the list page.
$(document).ready(function(){
<% If <table>.CurrentAction = "gridedit" Then %>
$("th[data-name='<field1>']").hide(); //hide the caption
$("td").has("[data-field='x_<Field1>']").hide(); //hide the field column
$("th[data-name='<field2>']").hide(); //hide the caption
$("td").has("[data-field='x_<field2>']").hide(); //hide the field column
<% End If %>
});

Scott
ready4data
 
Posts: 276
Joined: Mon Nov 19, 2012 8:24 pm


Return to Feature Requests (ASPMaker)