Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing jsp variable to 2 js variables

Status
Not open for further replies.

jannd

Programmer
May 14, 2002
3
US
I am attempting to confirm a delete request and pass a jsp variable to the confirm delete function and then to the actual function that performs the delete request.

The confirm works fine, the jsp variable is passed to the confirm delete function, but my actual delete function now fails.

Can anyone spot the error or why?

<input type=&quot;image&quot; src=&quot;./images/btn_delete.gif&quot; onClick=&quot;return confirmDelete('<%= section.getId()%>');&quot;>

// Confirm Delete Request
function confirmDelete(iSection) {
var yes=confirm('Are you sure you wish to delete ' + iSection + '?');
if (yes) {
return onDeleteSection('iSection');
}
else {
return false;
}
}

// Delete Section
function onDeleteSection(strSectionId){
document.sectionForm.Cmd.value = &quot;DeleteSection&quot;;
document.sectionForm.SectionID.value = strSectionId;
document.sectionForm.submit();
}
 
remove the quotes from onDeleteSection('iSection');

<input type=&quot;image&quot; src=&quot;./images/btn_delete.gif&quot; onClick=&quot;return confirmDelete('<%= section.getId()%>');&quot;>

// Confirm Delete Request
function confirmDelete(iSection) {
var yes = confirm('Are you sure you wish to delete ' + iSection + '?');
if (yes) {
return onDeleteSection(iSection);
}
else {
return false;
}
}

// Delete Section
function onDeleteSection(strSectionId){
document.sectionForm.Cmd.value = &quot;DeleteSection&quot;;
document.sectionForm.SectionID.value = strSectionId;
document.sectionForm.submit();
return true;
}

=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
I tried both with single quotes and without, not working yet. I'm continuing to try and solve the mystery, but please let me know if you have any other suggestions as to why the code would not be working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top