Is This A Bug In .net (Pls help me!!!!!!!!!)
-
Hi I m in big trouble can any one pls help me i have 2 textboxes which i validate using javascript and the initial focus is also set using javascript.And have one imagebutton name save and in the save imgbutton click i m writing some insert and update queries .I have added to the image button the javascript in the page_load event using attributes.add("onclick","javascript:return fucntion checkdata();") Now the problem comes when i use the mouse and click on the button then the javascript fires and when i directly press enter button then the page is posted back and the javascript does not fire i mean it should validate saying textbox1 cannot b empty since i m checking for empty values But on the another page if i m doing similar validation and the same code on this page when i press enter javascript fires and the page does not post back . My project partner also tired he is also getting the same result can any one pls help me out Patel Neelesh A
-
Hi I m in big trouble can any one pls help me i have 2 textboxes which i validate using javascript and the initial focus is also set using javascript.And have one imagebutton name save and in the save imgbutton click i m writing some insert and update queries .I have added to the image button the javascript in the page_load event using attributes.add("onclick","javascript:return fucntion checkdata();") Now the problem comes when i use the mouse and click on the button then the javascript fires and when i directly press enter button then the page is posted back and the javascript does not fire i mean it should validate saying textbox1 cannot b empty since i m checking for empty values But on the another page if i m doing similar validation and the same code on this page when i press enter javascript fires and the page does not post back . My project partner also tired he is also getting the same result can any one pls help me out Patel Neelesh A
Hi there, It seems to me that when you press Enter, the image button does not hold the focus. Is there any element on the web page which can cause the page to post back? IMO, you could not conclude that this is a bug in the .Net when you're not sure about the root cause. Also, I'm just curious that why you need to develop your own client script to validate the textbox whilst there are a number of validators available in the .Net framework.
-
Hi there, It seems to me that when you press Enter, the image button does not hold the focus. Is there any element on the web page which can cause the page to post back? IMO, you could not conclude that this is a bug in the .Net when you're not sure about the root cause. Also, I'm just curious that why you need to develop your own client script to validate the textbox whilst there are a number of validators available in the .Net framework.
As i have told u i have only 2 textboxand a image button.Can u pls try it ur self whats happening and by the way abt the validators ,v r not using the validators since the client wants it to be done with javascript i mean its the client requirement . Thanks Regards JINNY Patel Neelesh A
-
As i have told u i have only 2 textboxand a image button.Can u pls try it ur self whats happening and by the way abt the validators ,v r not using the validators since the client wants it to be done with javascript i mean its the client requirement . Thanks Regards JINNY Patel Neelesh A
+ Can you post a snippet of your actual code, that may help. What is the function checkdata(), also the code to add the javascript for the onclick event should look like:
attributes.add("onclick","javascript:return checkdata();")
+ In fact, the validator also uses the javascript to validate the value of the textbox at the client side, but it provides a much nicer way which can be used by the developer.