Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CDML and Java question for a button

2 views
Skip to first unread message

Peter Lessard

unread,
Jan 2, 2001, 11:13:56 AM1/2/01
to
Hi Guys,

Win98, FMP5.

I am modifying an online form so that it will submit to my database.
Currently the form has a print button that uses the following Java
Script:

<script>

function doit(){
if (!window.print){
alert("You need NS4.x to use this print button - Use your browser's
print button if this doesn't work!")
return
}
window.print()
}

</script>
<a href="javascript:doit()"><img
src="../../training_graphs/general/print.gif" width="87"
height="46" align="middle"></a></td>


and a submit button using the following CDML

(<INPUT TYPE="submit" NAME="NEW" VALUE="New Record">

I would like to have just one button instead of two. Just a print
button that prints and submits at the same time would be ideal but I am
unsure how to code it.

Thanks in advance,

Peter Lessard

pierre.lessard.vcf

Tim Booth

unread,
Jan 2, 2001, 5:42:52 PM1/2/01
to Peter Lessard

>
> Win98, FMP5.

Please call JavaScript correctly in the title of your post - I almost
skipped this

Well, the code for an image to be a submit looks like:

<INPUT TYPE=image border="0" src="print.gif"
width="87" height="46" name="-new" VALUE="New Record">

So, I wonder what happens if you enclose that with your JS call
for the printing??

Also, most of those JS print functions are notoriously unreliable -
there
are just so many possible things that might not work (in my case, that I
normally have JS turned off) - you may be better giving them
instructions
to use their own print function...

Cheers

Webko

Dennis De St Jeor

unread,
Jan 2, 2001, 6:16:58 PM1/2/01
to
You can do it two ways...

1. On your form submit button have an onClick="doit()"

or

2. Because you have an if/else statement in your JS then you could have a
step in your javascript to submit the form. You will need to name your form
<form name="myForm">. Then you can have that as a step in your script.

Good Luck,
Dennis

"Peter Lessard" <pierre....@alcatel.com> wrote in message
news:3A51FE44...@alcatel.com...

0 new messages