• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get Javascript popup window

 
Perumalla LakshmanaRao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

function

confirmAccountNum() {
var

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

if (agree){

document.createCaseForm.action = "<%=request.getContextPath() %>/addCaseList.do?CAF=E&caseNo=<%=request.getParameter("caseNo" )%>";
document.createCaseForm.submit();


}
else {

return false

;

}
}


// Case Creation Account Information Save Submit

function submitForm(actionFlagValue)

{

// Save Account Information

if(actionFlagValue == "saveaccount"){
if

(<%=acctnumflag%> {


confirmAccountNum();

}

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"];
loOpenSpan.style.display =

"";

}
and this is the logic yesterday we discussed.

ArrayList listacco = (ArrayList)request.getAttribute(

"caseAccountInfo");
if

(null != listacco){
session.setAttribute(

"caseAccountInfo",listacco);
}



/* Scriptlet Code for comparing Account Number */

Iterator iterList;
faccntnum = request.getParameter(

"ac_accountNumber");
System.out.println(

"faccntnum");

CaseAccountInfoVO caseAccountInfoVO;



iterList = listacco.iterator();


while (iterList.hasNext()) {

caseAccountInfoVO = (CaseAccountInfoVO) iterList.next();

System.out.println(

"caseAccountInfoVO");
aacctnum = caseAccountInfoVO.getAc_accountNumber();

System.out.println(

"aacctnum");

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

if(aacctnum.equalsIgnoreCase(faccntnum)){
acctnumflag =

true;

break;
}


else

{
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic