Re: How to include a java script in a php tag (form)
| From: | Dan Shirah | Date: | Tue, 12 May 2009 16:02:47 +0000 |
| Subject: | Re: How to include a java script in a php tag (form) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292503@lists.php.net to get a copy of this message | ||
>
> <?php
>
> and there is a special
>
> $html = ' blablablablabla ';
>
> where all the html code is written for the form (table,...).
>
> The problem is that I have to include a javascript to be able to send the
> form to my email address. I don't know where and how to put it.
>
> Could someone help me please?
>
Why not just have your "Send" button call the javascript?
//Create your javascript function
<script language="JavaScript">
<!--
function myScript(){
your email javascript
}
//-->
</script>
//Create your form
<?php
All your PHP code;
?>
//Make your "Send" button call your Javascript function
<input type="button" name="send" value="send"
onClick="javascript:myScript()">
HTH,
Dan