ENabling disabling form fields
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Saveta_rampersad
Posted On:   Tuesday, June 14, 2005 10:54 AM

I want to enable/disable form fields using an ArrayList. What I want to do is to put all the fields that I want to disable on a form load in an Array at server side on form load and then pass it to a JS function whiuch basically loop this ARRay and disable/enable all teh fields in it. So suppose I have an object "name" which contains first name and last name as Strings. I will put name object in an Array on form load and pass it to my JSP and in JSP I will call a JS passing the same ARray. I can pass the aray to JS but unable to retrieve elements from it. Any idea how I can do it. My JS function is like this function enableFormFields(theList){    More>>

I want to enable/disable form fields using an ArrayList. What I want to do is to put all the fields that I want to disable on a form load in an Array at server side on form load and then pass it to a JS function whiuch basically loop this ARRay and disable/enable all teh fields in it.


So suppose I have an object "name" which contains first name and last name as Strings. I will put name object in an Array on form load and pass it to my JSP and in JSP I will call a JS passing the same ARray.


I can pass the aray to JS but unable to retrieve elements from it.


Any idea how I can do it.


My JS function is like this

function enableFormFields(theList){

var myArray = theList;

alert(myArray.length);
alert(myArray);

for (var i=0, j=myArray.length; i
//alert(myArray[i].toString());
var myType = myArray[j].toString();
alert(myType);
break;

}
}

   <<Less

Re: ENabling disabling form fields

Posted By:   Firat_Tiryaki  
Posted On:   Wednesday, June 22, 2005 02:50 AM

you can do it with javascript but if you want stability why don't you just write "disabled" in the form element tags you want to disable?
About | Sitemap | Contact