Computing.Net > Forums > Windows 2000 > JSP problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

JSP problem

Reply to Message Icon

Name: Philip
Date: December 9, 2003 at 09:25:44 Pacific
OS: windows 2000
CPU/Ram: 256
Comment:

I have been trying to solve this problem for 3 days now. What happens is that if insertStatus==true, then the insert query will trigger without trying the if statement from my Javascript.For instance, if the user press the submit button(which is another jsp file),the window.confirm windows appears, but if I check the database, entries are already inserterted without trying the if statement from my Javascript.
Any help is appreciated.
Thanks,
---------------
<% if (insertStatus==false){ %>

<script language="Javascript">

alert("Error: Some values were not selected or some values were not recognized")

history.go(-1)

</script>

<%}

else {

%>

<script language="Javascript">

var p=window.confirm("Total amount is $"+<%=dollars%>+", Continue?")

if (p == true) {

alert("Entries will be inserted to the Database")

<%

stmt = "insert into orders values("+ordno+",'"+month+"',"+"'"+cid+"',"+"'"+aid+"',"+"'"+pid+"',"+qty+","+dollars+")";

insertStatus = myCBean.updateTable(stmt);

if (insertStatus){

%>

document.write("Entries successfully inserted")

<%}

else { %>

document.write("Error while trying to insert values")

<%}%>

}

else {

<% insertStatus = false;%>

history.go(-1)

}

</script>

<%}%>



Sponsored Link
Ads by Google

Response Number 1
Name: philp
Date: December 9, 2003 at 09:30:15 Pacific
Reply:

Oops, wrong section, is there a way to put this message in the Programming section?


0
Reply to Message Icon

Related Posts

See More


Alternative Download For ... MusicMatch: Multiple User...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: JSP problem

Problem with 16-bit color display www.computing.net/answers/windows-2000/problem-with-16bit-color-display/37963.html

win 98 and win 2000 (dual boot problem) www.computing.net/answers/windows-2000/win-98-and-win-2000-dual-boot-problem/34582.html

svchost.exe problem www.computing.net/answers/windows-2000/svchostexe-problem/51183.html