0 Replies - 328 Views - Last Post: 28 June 2020 - 06:06 AM

#1 tester1234   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 08-December 15

jsp form processing problem

Posted 28 June 2020 - 06:06 AM

i have login.jsp page with 2 input field and 2 buttons, nomal and abnormal button respectively.
when normal button click, it will submit form and redirect to home.jsp
when abnormal button is clicked, it will submit form and redirect to home.jsp too.

in main.jsp, how can i check login.jsp form_submit's parameter in main.jsp when the user click the login.jsp
to display different <h1> content in main.jsp depending on previous page.




<form action = "main.jsp" method = "POST">
First Name: <input type = "text" name = "first_name">
<br />
Last Name: <input type = "text" name = "last_name" />
<input onclick= "form_submit(normal);"  type="submit" value = "normal_submit" />
<button onclick="form_submit(abnormal);" type="submit" value="abnormal_submit"



--------------------------------------------------------------------Main.jsp -------------------------------------------
<title>Using GET and POST Method to Read Form Data</title>

<%=if abnormal submit button click%>
<h1>this is abnormal button click</h1>
</if=%> //how to check value ?
<%= if normal button click%>
<h1> this is redirect from normal button click</h1>
</if =%>

<li><p><b>First Name:</b>
<%= request.getParameter("first_name")%>
<li><p><b>Last Name:</b>
<%= request.getParameter("last_name")%>


This post has been edited by modi123_1: 28 June 2020 - 10:27 AM
Reason for edit:: In the future please use the [code] tag button in the editor

Is This A Good Question/Topic? 0
  • +

Page 1 of 1