why infinite loop in this simple java script to check empty ?
Hi Friends, var d= getTagFromIdentifierAndTitle("Select","DropDownChoice","Completion Status"); var CompModules = getTagFromIdentifierAndTitle("INPUT","TextField","Completed Modules"); if (d.value=='Not Started' && CompModules!="") { alert('Please donot fill completed Modules,as Your Status is Not Started!'); return false ; } return true; and respective column in list is simply choice and single line of text(Moss 2007) i am getting alert every time either i fill completed modules or not .........it should not be ..as my condition is seeming ryt Please help sudhanshu sharma
September 9th, 2011 9:14am

You condition is right but seems to code error change CompModules!="" to CompModules.value !="" Rahul Sharma http://sharepointarrow.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
September 10th, 2011 2:46am

Hi Rahul, I already tried with this CompModules.value !="" ,CompModules.value !=0,CompModules.value !=null but after writing this i am getting error in all 3 combinations value is null or not an object..........so i tried with CompModules!="" but problem is this is working but running infinitely ..... i want to clarify 1 thing -i also did a validation (server side).....by AS.Net validation control(regular expression).......if someone enter character then it shud not be accept.......... and for client side .....i am writing this java script.........if training status== not started && completed modules !="" then alert.................... sudhanshu sharma
September 11th, 2011 11:42pm

See your function getTagFromIdentifierAndTitle returning the object of the control not its value. like for 'd'. So it always return true for your control. First check wether your control object is coming from your function or not. Then check the control object is same or returning other object. and try below condition if( CompModules !="undefined" to CompModules.value !="undefined" Rahul Sharma http://sharepointarrow.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
September 12th, 2011 1:26am

my script worked well but as i insert custom list form and do more validations by controls then i got 'value ' is null or not an object error. > sudhanshu sharma
September 12th, 2011 1:43am

Hi Rahul, May i know ur contact id if u dont mind(: sudhanshu sharma Do good and cast it into river :)
Free Windows Admin Tool Kit Click here and download it now
May 23rd, 2012 9:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics