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. General Programming
  3. C#
  4. java script problem

java script problem

Scheduled Pinned Locked Moved C#
javatoolshelpquestion
8 Posts 4 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.
  • A Offline
    A Offline
    ayyp
    wrote on last edited by
    #1

    hi all,in my page load event,i given as Response.Write("function check(){for(var j=0;j<al.length;j++){if(window.document.Form1.Text3.value==al[j]){alert(al[j])}}}"); btnsubmit.Attributes.Add("onclick","check();"); but when i click the button(btnsubmit)first time it doesnot show alert msg but when i click the same button again it display the alert what is the prob with my code.... :confused: Regards, ayyp

    V D P 3 Replies Last reply
    0
    • A ayyp

      hi all,in my page load event,i given as Response.Write("function check(){for(var j=0;j<al.length;j++){if(window.document.Form1.Text3.value==al[j]){alert(al[j])}}}"); btnsubmit.Attributes.Add("onclick","check();"); but when i click the button(btnsubmit)first time it doesnot show alert msg but when i click the same button again it display the alert what is the prob with my code.... :confused: Regards, ayyp

      V Offline
      V Offline
      V 0
      wrote on last edited by
      #2

      please post these questions to the web development board or the asp.net board;;; I've found a living worth working for, but I haven't found work worth living for. :beer:
      :jig:

      1 Reply Last reply
      0
      • A ayyp

        hi all,in my page load event,i given as Response.Write("function check(){for(var j=0;j<al.length;j++){if(window.document.Form1.Text3.value==al[j]){alert(al[j])}}}"); btnsubmit.Attributes.Add("onclick","check();"); but when i click the button(btnsubmit)first time it doesnot show alert msg but when i click the same button again it display the alert what is the prob with my code.... :confused: Regards, ayyp

        D Offline
        D Offline
        DIMPLE_R
        wrote on last edited by
        #3

        i tried the following...did not encounter any such error.. Response.Write("function check(){alert('a');}") Button1.Attributes.Add("onclick", "check()") you may have to provide more details :)

        A 1 Reply Last reply
        0
        • A ayyp

          hi all,in my page load event,i given as Response.Write("function check(){for(var j=0;j<al.length;j++){if(window.document.Form1.Text3.value==al[j]){alert(al[j])}}}"); btnsubmit.Attributes.Add("onclick","check();"); but when i click the button(btnsubmit)first time it doesnot show alert msg but when i click the same button again it display the alert what is the prob with my code.... :confused: Regards, ayyp

          P Offline
          P Offline
          psamy
          wrote on last edited by
          #4

          Hi, you try this code it works. Response.Write("function check(){alert('hi')}"); btnSubmit.Attributes.Add("onclick","check();");

          A 1 Reply Last reply
          0
          • P psamy

            Hi, you try this code it works. Response.Write("function check(){alert('hi')}"); btnSubmit.Attributes.Add("onclick","check();");

            A Offline
            A Offline
            ayyp
            wrote on last edited by
            #5

            s it work but when i call this function it wont work function check() { for(var j=0;j

            P 1 Reply Last reply
            0
            • D DIMPLE_R

              i tried the following...did not encounter any such error.. Response.Write("function check(){alert('a');}") Button1.Attributes.Add("onclick", "check()") you may have to provide more details :)

              A Offline
              A Offline
              ayyp
              wrote on last edited by
              #6

              s it work but when i call this function it wont work function check() { for(var j=0;j

              1 Reply Last reply
              0
              • A ayyp

                s it work but when i call this function it wont work function check() { for(var j=0;j

                P Offline
                P Offline
                psamy
                wrote on last edited by
                #7

                Hi make it function like this , function check() { for(var j=0;j{ if(window.document.Form1.Text3.value==al[j]) { alert(al[j]); return true } } return false; }

                D 1 Reply Last reply
                0
                • P psamy

                  Hi make it function like this , function check() { for(var j=0;j{ if(window.document.Form1.Text3.value==al[j]) { alert(al[j]); return true } } return false; }

                  D Offline
                  D Offline
                  DIMPLE_R
                  wrote on last edited by
                  #8

                  hi, I'm not sure what you are trying to do..and i think there may be a problem with your syntax: I tried something similar as follows: function check() { var al=new Array(); al[0]=1; al[1]=2; for(var j=0;j<=3;j++) { //alert(window.document.Form1.Text3.value); alert(al[j]); if(window.document.Form1.Text3.value==al[j]) { //alert("in"); return true; } else { alert("else"); //return false; } } }

                  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