October 28, 2003

Two Buttons on call

In Programming there are times when, the user needs to make a choice. Once action button will move the user in one direction, another in a totally different direction. I find it easiest to offer the user two action buttons, and have the buttons call the routine for submission.

For example:

<input NAME="Submit" value="MoveNext" onClick="MoveNext();">
<input NAME="Submit" value="MovePrevious" onClick="MovePrevious();">

The onclick function triggers before the onsubmit function, which allows you to determine how to submit the choice with these javascript functions:

function MoveNext(){
with (document.frm)
{
action = 'actMoveNextPage.cfm';
submit();
}
}

function MovePrevious(){
with (document.frm)
{
action = 'actMovePreviousPage.cfm';
submit();
}
}

Posted by Elyse at October 28, 2003 9:07 PM
Comments

This is on a tangent here -- but is there a function that moves to the start or end of an XML list? MoveHome?!?! MoveStart?!?!?

I've googled for this, but can't find anything. I am building a simple page that shows a contact list from an XML file, and I have Javascript doing the MoveNext and MovePrevious to scroll through, but I need to have the ability to go to the start or the end with a button.

Thanks, and sorry if this is too far off topic.

Posted by: Joe at September 13, 2005 11:21 AM