accessing page - enabling "sign in" button from login page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SagarDoke
    New Member
    • Feb 2008
    • 24

    accessing page - enabling "sign in" button from login page

    suppose there are 2 files "1.html" and "login.html ".
    from "1.html" i am opening second page "login.html ". "1.html" contain one button with value "signin". when i clicked on that button login form will be displayed and i disabled that button using document.form.b utton_name.disa bled=true;

    but if login failed or cancel the login form, then how can i enabled that button again from "login.html ".
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Post your code. Why are you disabling the button in the first place?

    Comment

    • SagarDoke
      New Member
      • Feb 2008
      • 24

      #3
      Originally posted by acoder
      Post your code. Why are you disabling the button in the first place?
      Hi,
      <button name="SignIN" onClick="getSig nin()">Sign-In</button> to call the function "getSignin"

      [CODE=javascript]function getSignin()
      {
      x = (1280 - 290)/2, y = (800 - 150)/2;

      if (screen)
      {
      y = (screen.availHe ight - 150)/2;
      x = (screen.availWi dth - 290)/2;
      }

      window.open("ht tp://localhost/ForumCreation/3.html","Login" , "width=290,heig ht=150,screenX= "+x+",screenY=" +y+",top="+y+", left="+x);
      document.form12 .SignIN.disable d = true;
      } [/CODE]

      here, i am disabling that SignIN button. if not here then, how can i disabled that button from second place?
      Last edited by acoder; Feb 12 '08, 09:08 AM. Reason: Added code tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Right, I see you're opening a popup window. From the child window, use window.opener.d ocument.forms["form12"].elements["signIN"].disabled = false.

        Comment

        • SagarDoke
          New Member
          • Feb 2008
          • 24

          #5
          Originally posted by acoder
          Right, I see you're opening a popup window. From the child window, use window.opener.d ocument.forms["form12"].elements["signIN"].disabled = false.
          Sorry, but its not working. i thing I'm doing something wrong:

          [HTML]<center>
          User Name: <input type="text" name="name"><p> </p>
          &nbsp; Password: <input type="password" name="psswd">
          <p></p><input type="image" src="Classic2.G IF" onClick="getVal ue()">
          <input type="image" src="Classic.gi f" onClick="exit() ">
          </center>

          <script language="JavaS cript">
          function getValue()
          {
          var str1 = document.Forum. name.value;
          var str2 = document.Forum. psswd.value;
          var url = "4.jsp?name="+s tr1+"&psswd="+s tr2+"&status=lo gin";
          window.open(url ,"_blank");
          window.close();
          }
          function exit()
          {
          window.opener.d ocument.forms["form12"].elements["signIN"].disabled = false;
          window.close();
          }
          </script>[/HTML]

          When i clicked on cancel, then exit function called by that event. after that nothing is happened. i used jsp for database connection. when it called jsp file there i check that username and password. how can i check that username and password without opening that jsp page? there is no need of open that page. again if login failed how can i enabled sign-in button from first page? i am not getting that ajax for database connectivity.
          Last edited by acoder; Feb 12 '08, 09:07 AM. Reason: Added code tags

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            window.opener should be in the popup window, but now you mention that you want to avoid opening the window and want to use Ajax. Is that correct?

            Comment

            Working...