CDML and Java question for a button 
Author Message
 CDML and Java question for a button

  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
< 1K Download


Sun, 22 Jun 2003 00:13:56 GMT
 CDML and Java question for a button

Quote:

> Win98, FMP5.

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

> 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.

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



Sun, 22 Jun 2003 06:42:52 GMT
 CDML and Java question for a button
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


Quote:
>   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



Sun, 22 Jun 2003 07:16:58 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. CDML Next and Previous Button within a found set

2. CDML and portal rows : add + delete buttons

3. ---JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA---

4. CDML & Web publishing question

5. CDML and User Input Question...

6. CDML question

7. 2 FM Unlimited 6.0 CDML questions

8. CDML question, version 4

9. CDML with script question

10. CDML FMPro 4 - LOP question

11. CDML Question

12. CDML Question


 
Powered by phpBB® Forum Software