0

I am writing a html login form which gets the user Id as input and confirm button for the user to confirm.. After the user enters the user ID I want to set that value in a session variable and retrieve in the next page which JSP.

    <SCRIPT LANGUAGE=JavaScript>
  {
  funtion confirm()
  {

  String id = document.login.name.value;
    HttpSession s= request.getSession(true);
    s.setAttribute("user",id);
    document.login.action = document.location.protocol + "//" + "test.com" + "/jsp/confirm/con.jsp";
    }
  }

In the next page which is a JSP file, I get the session value using below scriptlets

<% session.getAttribute("user"):%>

When I click on confirm button, it does nothing and the IE debugger throws

confirm();

The value of the property 'confirm' is null or undefined, not a Function object

Could you please help me with this as I am not clear why it does not work.

NewB
  • 1
  • 2
  • Are you disallowed from using a proper javascript – Sarath Chandra Feb 09 '16 at 08:51
  • Alright! I used the script tag but the result is same :( – NewB Feb 09 '16 at 09:23
  • 1
    Should be `function` instead of `funtion`, but mixing Java in your Javascript is not gonna fly. – Robby Cornelissen Feb 09 '16 at 10:08
  • Any other opinions from experts? My question is very specific and I am already aware of the conceptual part which is explained in the link that is used to mark my post as duplicate :| – NewB Feb 10 '16 at 05:16

0 Answers0