Thursday, December 21, 2006

Javascript on Form not working

Hi all,

I was hiting myself after wasting 3 hours in finding the issue. Let me explain you what the issue is all about.

I was asked to write a Javascript code which will be called on click of a Submit button. I checked the button, it was already calling a function so I thought I will append the code to the existing function. I wrote my code, but my code was no way executing.

Problem started here, I searched in the team studio configurator and got the functions with the same function name in lot of places, say for eg the code was there in the form JS Header, in the Subform JS Header and in the Page also, so I don't know which function will trigger, as usual :-) I started giving alert in each function to check which function the Submit button is calling. I got the result :-( non of the functions, non of my alerts triggered.

At last I found it in the Form, the code which I wrote was in the Java Script of the client not the web. Our previous developer copied the same code both in Web and Client and atlast he changed the option to client which I didn't notice. Good that I found in 3 hours not in 3 days :).
Hope you will check when you JS is not working in JS Header on web.

Thanks
Karthik

No comments: