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. simple javascript code [modified]

simple javascript code [modified]

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
6 Posts 3 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.
  • P Offline
    P Offline
    PeriyasamyRamachandran
    wrote on last edited by
    #1

    Hi, If the Textbox value is empty then, when i click "Ok" button an alert should display as "Please Enter the value for textbox" and simultaneously i have to display an "*"(Asteristic) only if the textbox is empty. Otherwise don't display. Please help me.. if(document.getElementById('txtbox').value=="") { alert('Enter text value'); return false; } -------

    modified on Wednesday, December 19, 2007 7:04:52 AM

    N P 2 Replies Last reply
    0
    • P PeriyasamyRamachandran

      Hi, If the Textbox value is empty then, when i click "Ok" button an alert should display as "Please Enter the value for textbox" and simultaneously i have to display an "*"(Asteristic) only if the textbox is empty. Otherwise don't display. Please help me.. if(document.getElementById('txtbox').value=="") { alert('Enter text value'); return false; } -------

      modified on Wednesday, December 19, 2007 7:04:52 AM

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      So what's the problem here ? Why don't you use validation control ?

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      P 1 Reply Last reply
      0
      • N N a v a n e e t h

        So what's the problem here ? Why don't you use validation control ?

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        P Offline
        P Offline
        PeriyasamyRamachandran
        wrote on last edited by
        #3

        yes here i used validation as below you see if(document.getElementById('txtvalue').value=="") { alert('Entertext value'); document.getElementById('Asteristic').style.display="inline"; return false; } but it says "Object required". How can i display the "*"(label control) only if the textbox is null?

        N 1 Reply Last reply
        0
        • P PeriyasamyRamachandran

          Hi, If the Textbox value is empty then, when i click "Ok" button an alert should display as "Please Enter the value for textbox" and simultaneously i have to display an "*"(Asteristic) only if the textbox is empty. Otherwise don't display. Please help me.. if(document.getElementById('txtbox').value=="") { alert('Enter text value'); return false; } -------

          modified on Wednesday, December 19, 2007 7:04:52 AM

          P Offline
          P Offline
          Paddy Boyd
          wrote on last edited by
          #4

          Your textbox id is txtTickInfo, not txtbox.

          P 1 Reply Last reply
          0
          • P Paddy Boyd

            Your textbox id is txtTickInfo, not txtbox.

            P Offline
            P Offline
            PeriyasamyRamachandran
            wrote on last edited by
            #5

            Good. Thanku very much

            1 Reply Last reply
            0
            • P PeriyasamyRamachandran

              yes here i used validation as below you see if(document.getElementById('txtvalue').value=="") { alert('Entertext value'); document.getElementById('Asteristic').style.display="inline"; return false; } but it says "Object required". How can i display the "*"(label control) only if the textbox is null?

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              PeriyasamyRamachandran wrote:

              if(document.getElementById('txtvalue').value=="")

              I guess your textbox name is txtTickInfo. Check that

              All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

              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