0

Hi there, I created few step order form. I use function below to move to the next step of order, but at the same time when customer press button it shoudl called function: onClick="takeDetalis(0)" in js sheet and take personal detalis. But because (0) is treated as error.

<script type="text/javascript">
<!--
function takeOrder(num) {
var url=new Array();
url[0]="confirm.html";

window.location=url[num];
}
// -->
</script>

So any idea how to take detalis and automatically move order to the next stage (page) ??

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Airshow
0

Functions can call other functions, so you might want something like this:

function takeOrder(num) {
  var url=new Array();
  url[0]="confirm.html";
  var details = takeDetalis(num);//pass num in case takeDetails() needs it
  if(details){
    window.location = url[num] + '?' + details;
  }
}

Where takeDetalis() is a function that displays a dialog and returns:

  • a url-encoded query string representing the user's data,
  • false if the user cancels

Airshow

Edited by Airshow: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.