I use MS VS 2012 with IIS Express under Win7 to develop a web site. When I run my web site under VS2012 in Win7, it's fine.
However, when I publish the web site to Window Server 2012 with IIS 8, and open the page (http://......), even in Win7, some unexpected error occurs (Javascript related).
Let me describe a little bit more...
Actually, I got 2 text boxes with Javascript coded in OnFocus and OnBlur event (in both text boxes). The OnFocus event will save the value in the textbox when it gets focus before modify, and OnBlur event will do some checking on the modified value in the textbox, and if it is false, a message box prompted up, and then the value of the textbox will be changed back to previous one, and setting the focus to 1st textbox. If it's true, the focus will go to 2nd textbox.
When I run this web site under VS2012 environment in Win7, it works well. However, when I publish this web site to Window Server 2012 with IIS8, and open IE and open the link under Win7, something strange occurs. When user finishes input the value in the textbox 1 and press tab key, normally the cursor will go to 2nd textbox if the condition is true. If the condition is false, the OnFocus and OnBlur events are triggered twice (1 from 1st textbox, 1 from 2nd textbox), and the value of 2nd textbox is also set to the initial value of the 1st textbox.
I understand why the 2nd textbox also triggers OnFocus and OnBlur event (it triggers when the focus is set from 2nd textbox back to 1st textbox). However, I don't understand why the value in 2nd textbox is set to the initial value of the 1st textbox. The value in 2nd textbox should remain unchanged, because the OnFocus event will store its initial value when it got focus. When it leaves focus and go back to 1st textbox, the value of the 2nd textbox should be set to its initial value of the 2nd textbox (both should be equal), but now it's set to the initial value of the 1st textbox. The focus is finally on the 2nd textbox, not the 1st textbox.
Since I am a beginner in Javascript and VS2012, I really need every help. Anyone can help or hv a similar experience??
Thanks a lot.
Eric