This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Struts and the fly likes How to get Javascript popup window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to get Javascript popup window" Watch "How to get Javascript popup window" New topic

How to get Javascript popup window

Perumalla LakshmanaRao

Joined: Sep 03, 2006
Posts: 9
Hi All,
My problem is in javascript.It's checking the account number and updating the data.But before updationg we have to show the popup window like "account number is exist do you want update" this.I written javascript but popup window is not displaying,without showing window it is updating the data.If we click on Yes button in popwindow window then only it must update the data.Iam sending my javascript code please check it.


confirmAccountNum() {

agree = confirm('<bean:message key="common.confirmAccountNum" />');

if (agree){

document.createCaseForm.action = "<%=request.getContextPath() %>/<%=request.getParameter("caseNo" )%>";

else {

return false



// Case Creation Account Information Save Submit

function submitForm(actionFlagValue)


// Save Account Information

if(actionFlagValue == "saveaccount"){

(<%=acctnumflag%> {



document.createCaseForm.hidden_accinfo_accountno.value = document.createCaseForm.ac_accountNumber.value;
document.createCaseForm.hidden_accinfo_accounttype.value = document.createCaseForm.ac_accountType.value;

document.createCaseForm.hidden_accinfo_comment.value = document.createCaseForm.ac_comment.value;

var loOpenSpan = document.all["CaseAccount_1_open"]; =


and this is the logic yesterday we discussed.

ArrayList listacco = (ArrayList)request.getAttribute(


(null != listacco){


/* Scriptlet Code for comparing Account Number */

Iterator iterList;
faccntnum = request.getParameter(



CaseAccountInfoVO caseAccountInfoVO;

iterList = listacco.iterator();

while (iterList.hasNext()) {

caseAccountInfoVO = (CaseAccountInfoVO);


aacctnum = caseAccountInfoVO.getAc_accountNumber();



/* comparing accntnum with existing account numbers in database*/

acctnumflag =




acctnumflag = false;



This acctnumflag value I am passing into if loop under javascript function.It's value is true.If true only we have to update our data.That's why I send this string from jsp to javascript.My doubt is how I will send jsp data to javascript for getting the operation.
I agree. Here's the link:
subject: How to get Javascript popup window
jQuery in Action, 3rd edition