Without having looked at your code too much, I have another suggestion,
which may make this easier to maintain and understand:
<a href="JavaScript:doSubmit();"</a>
Then create a function that does all what you had in your a href:
function doSumbit()
{
form1.return_anchor.value='x';
form1.prod_standard.value='yes';
form1.last_entry_save.value='yes';
if (check(form1))
{
form1.submit();
}
}
This will make it much easier to debug and see what actually happens.
One more thing: in your function check() you are checking for the value
'ja' (Dutch??) but in the a href you set the value to 'yes' (OK, so I did
look at the code ;-))
That's causing the problem??
HtH
Imar
At 10:50 AM 11/22/2001 +0100, you wrote:
>Hello everybody,
>
>does someone know how I can avoid this printing to screen with a line like
>this?
>
><a
>href="javascript:form1.return_anchor.value='x';form1.prod_standard.value='ye
>s';form1.last_entry_save.value='yes';if (check(form1)) form1.submit();">make
>standard production</a>
>
>I keep getting a print "yes"....strange....I deducted it comes from:
>form1.last_entry_save.value='yes'
>
>It seems I have to 'escape' the href somehow if my condition is not
>met....but I don't know how...maybe with an 'else'? But else what?
>
>here's the function:
>
>function check(form) {
> var message = "";
> if (form.prod_standard.value == "ja" &&
> (form.standard_production_id.value
>== "" && form.alternative.value == '')) message = message+"You have to
>submit a name under 'alternative name' if you want to make this production a
>standard one.\nThis may be the same name as an existing one. That one will
>then be overwritten with the current settings.";
> if (message != "") {
> alert("Notice:\n\n"+message);
> return false;
> } else return true;
>}
>
>Maurice