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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Validation Problem

Validation Problem

Scheduled Pinned Locked Moved ASP.NET
helpcsharpjavascript
5 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.
  • S Offline
    S Offline
    Sushant Duggal
    wrote on last edited by
    #1

    Hi Friends, I am having 2 submit buttons on one page. One is to search and other is for newsletter subscription. When i add text to search textbox and press enter, it validates the other text box which is to enter emailID for the subscription button. I am not using the .NET validators. I am using my own javascript file. I tried to check the enter keycode for search textbox and then make the search button click in the javascript, but still the validator fires and then the search button clicks. Please Help.

    Sushant Duggal.

    _ S 2 Replies Last reply
    0
    • S Sushant Duggal

      Hi Friends, I am having 2 submit buttons on one page. One is to search and other is for newsletter subscription. When i add text to search textbox and press enter, it validates the other text box which is to enter emailID for the subscription button. I am not using the .NET validators. I am using my own javascript file. I tried to check the enter keycode for search textbox and then make the search button click in the javascript, but still the validator fires and then the search button clicks. Please Help.

      Sushant Duggal.

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      you have to write a javascript function which will trap the enter key and then envoke the button which you want to. :)

      Best Regards, Apurva Kaushal

      S 1 Reply Last reply
      0
      • _ _AK_

        you have to write a javascript function which will trap the enter key and then envoke the button which you want to. :)

        Best Regards, Apurva Kaushal

        S Offline
        S Offline
        Sushant Duggal
        wrote on last edited by
        #3

        Hi, I already did that

        function gotoSearch()
        	{		
        		if(event.keyCode == 13)
        		{
        			document.getElementById('btnSearch').click();
        			return false;
        		}
        	}
        

        It validates the other textbox validation, and then fires the btnsearch click event.

        Sushant Duggal.

        _ 1 Reply Last reply
        0
        • S Sushant Duggal

          Hi, I already did that

          function gotoSearch()
          	{		
          		if(event.keyCode == 13)
          		{
          			document.getElementById('btnSearch').click();
          			return false;
          		}
          	}
          

          It validates the other textbox validation, and then fires the btnsearch click event.

          Sushant Duggal.

          _ Offline
          _ Offline
          _AK_
          wrote on last edited by
          #4

          Are you getting inside this function? Put a alert and check whether this function is getting called correctly or not.

          Best Regards, Apurva Kaushal

          1 Reply Last reply
          0
          • S Sushant Duggal

            Hi Friends, I am having 2 submit buttons on one page. One is to search and other is for newsletter subscription. When i add text to search textbox and press enter, it validates the other text box which is to enter emailID for the subscription button. I am not using the .NET validators. I am using my own javascript file. I tried to check the enter keycode for search textbox and then make the search button click in the javascript, but still the validator fires and then the search button clicks. Please Help.

            Sushant Duggal.

            S Offline
            S Offline
            Sushant Duggal
            wrote on last edited by
            #5

            Hi Friends, I am having 2 submit buttons on one page. One is to search and other is for newsletter subscription. When i add text to search textbox and press enter, it validates the other text box which is to enter emailID for the subscription button. I am not using the .NET validators. I am using my own javascript file. I tried to check the enter keycode for search textbox and then make the search button click in the javascript, but still the validator fires and then the search button clicks. Please Help.

            Sushant Duggal.

            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