Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Is This A Bug In .net (Pls help me!!!!!!!!!)

Is This A Bug In .net (Pls help me!!!!!!!!!)

Scheduled Pinned Locked Moved ASP.NET
helpcsharpjavascriptannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jinnyb
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • J jinnyb

      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

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      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.

      J 1 Reply Last reply
      0
      • M minhpc_bk

        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.

        J Offline
        J Offline
        jinnyb
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • J jinnyb

          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

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          + 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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups