abovetopsecret
Programmer
I am in the process of putting together an ecommerce site for my clients using zen cart.
I wanted to make a text field mandatory and have managed to adapt the code with a few changes all round the folders, to get this working. But all I need to do is when an alert pops up and it has 2 errors in it, that the one below moves underneath it, not on the same line.
And its this where I need the help, the code is below but i dont know where or hot to put teh line break in to get this working.
as you can see there are 2 error messages in there, on their own they are fine, but when they both appear they stay on the same line.
Cheers
I wanted to make a text field mandatory and have managed to adapt the code with a few changes all round the folders, to get this working. But all I need to do is when an alert pops up and it has 2 errors in it, that the one below moves underneath it, not on the same line.
And its this where I need the help, the code is below but i dont know where or hot to put teh line break in to get this working.
Code:
$js .= "\n" . ' if (payment_value == null && submitter != 1) {' . "\n" .
' error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
' error = 1;' . "\n" .
' }' . "\n\n" .
' if (document.checkout_payment.comments.value == "" && submitter != 1) {' . "\n" .
' error_message = error_message + "' . JS_ERROR_NO_TEXT_ENTERED . '";' . "\n" .
' error = 1;' . "\n" .
' }' . "\n" .
' if (error == 1 && submitter != 1) {' . "\n" .
' alert(error_message);' . "\n" .
' return false;' . "\n" .
' } else {' . "\n" .
' return true;' . "\n" .
' }' . "\n" .
'}' . "\n" .
'//--></script>' . "\n";
as you can see there are 2 error messages in there, on their own they are fine, but when they both appear they stay on the same line.
Cheers