javascript problem

Hi, for the purpose of debugging i want to use an alert('hallo) to test if the form was submitted… so i put

echo "<script> alert('test'); </script>";

in the onValidate event… but when i submit the form just nothing happens. I also tried

$javascript_function  = 'alert'; // Javascript function name
$javascript_parameters = array('hallo');
sc_ajax_javascript($javascript_function, $javascript_parameters);

as proposed by scriptcase but still nothing… i also put it in onLoad but still no effect.
Am i doing something wrong ?

Re: javascript problem

sc_ajax_javascript is to use when you have ajax functions … like the events of the fields(onchange, onclick…).

When you submit a form, the form is submitted and the php code is executed(onValidate, onValidateSeccess or Fail …) so, you cant execute javascript on the server side. JavaScript is on the client side(browser).

If you want to execute javascript, edit the itself.

Form menu -> Javascript.

[QUOTE=diogo;3551]sc_ajax_javascript is to use when you have ajax functions … like the events of the fields(onchange, onclick…).

When you submit a form, the form is submitted and the php code is executed(onValidate, onValidateSeccess or Fail …) so, you cant execute javascript on the server side. JavaScript is on the client side(browser).

If you want to execute javascript, edit the itself.

Form menu -> Javascript.[/QUOTE]

I use php to javascript option because not know another way to do it. The point is I want to run the php code, send a message to the user to
‘Accept’ or ‘cancel’ and function of the selection of the option, php app execute one form or another grid.

How I can do it, with your explication ??

The code I use is as follows:

php (OnValidate) -----

sc_ajax_javascript (‘ValidarOpcion’);
if ({field_Result == ‘yes’) {OpenForm}

javascript ------

ValidarOpcion () {
if (confirm (‘Would you like continue?’)) {

       { Field_Result } = 'True';

} Else {

      { Field_Result } = 'False';

}
}

How I can do it, with your explication ?? (Form menu-> Javascript)
thanks