Forums Register Login

please advise me on this

+Pie Number of slices to send: Send
hi folks,
I really dont know why this is coming and what to do about this.
I have a jsp page..a simple registration form...on clicking the submit button, i am setting a hidden parameter in a js function and reloading the page....
in the body of the page i have given an if condition using the hidden paramter to upload the db table ...
<code>
if(request.getParameter("param")!=null && request.getParameter("param").equals("1"))
{
str_FirstName=adjquotes(request.getParameter("txt_FirstName"));
str_MiddleName=adjquotes(request.getParameter("txt_MiddleName"));
str_LastName=adjquotes(request.getParameter("txt_LastName"));
int_age=Integer.parseInt(request.getParameter("txt_Age"));
str_address = adjquotes(request.getParameter("txt_Address"));
str_city = adjquotes(request.getParameter("txt_City"));
str_state = adjquotes(request.getParameter("txt_State"));
int_zip = Integer.parseInt(request.getParameter("txt_Zip"));
str_country = adjquotes(request.getParameter("txt_Country"));
str_email = adjquotes(request.getParameter("txt_Email"));
//construct the insert statement
str_insert="insert into tr_registration(first_name,middle_name,last_name,age,address,city,state,zip,country,reg_dt,email) values('"+str_FirstName+"','"+str_MiddleName+"','"+str_LastName+"','"+int_age+"','"+str_address+"','"+str_city+"','"+str_state+"',"+int_zip+",'"+str_country+"',to_char(sysdate,'dd/mm/yyyy'),'"+str_email+"')";
System.out.println(str_insert);
i=stmt.executeUpdate(str_insert);
if(i!=0)
{%>
<script language="javascript:alert('Congratulations!!! You have been successfully registered');"/>
<%
response.sendRedirect("home.jsp");
System.out.println("After the sendRedirect");
}
else
{
%>
<script language="javascript"> alert("Sorry there was a problem with the registration, Please try again");</script>
<%}
// mail.send(str_email);

}

Now i am facing 2 problems
i) those javascript alerts are not coming. is there something wrong there?
ii) when i do a response.sendRedirect to that home.jsp; the page is opening fine, but even after the page has opened in the status bar i am getting...
opening home.jsp.....
PLzz help ....
Regards,
Prasenjit
+Pie Number of slices to send: Send
this is not right:
<script language="javascript:alert('Congratulations!!! You have been successfully registered');"/>
code it like the other one!
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1068 times.
Similar Threads
Display of Latin Characters
detech javascript enabled server-sice
Require help in submitting <form> through JavaScript function
Javascript code inside JSP (error in flushing)
Posting a form to a hidden frame in the same page
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:59:12.