| View previous topic :: View next topic |
| Author |
Message |
dazz_club 250+ Club

Joined: 15 Jul 2005 Posts: 313 Location: Chester and Hull
|
Posted: Sun Oct 16, 2005 5:36 pm Post subject: assign a javascript call function to a submit button |
|
|
| Hi people, how would i assign a javascript function call to a submit button, ive looked in actions section and cant find it, any ideas to how this could be done? |
|
| Back to top |
|
 |
|
|
Samuel Rounce 100+ Club

Joined: 30 Oct 2005 Posts: 116 Location: London, UK
|
Posted: Mon Nov 28, 2005 6:32 pm Post subject: Re: assign a javascript call function to a submit button |
|
|
Apply this to the button:
| Code: |
submit = function() {
fscommand(submitbut);
};
but_mc.onRelease(
submit();
};
|
Insert this Javascript into the head of your HTML file:
| Code: |
<SCRIPT LANGUAGE=JavaScript>
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function sampleFlaMovie_DoFSCommand(command, args)
{
var sampleFlaMovieObj =
InternetExplorer ? sampleFlaMovie : document.sampleFlaMovie;
//
if (command == "submitbut")
document.formname.submit();
//
}
// Hook for Internet Explorer
if (navigator.appName &&
navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 &&
navigator.userAgent.indexOf("Windows 3.1") == -1)
{
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write(
'Sub sampleFlaMovie_FSCommand(ByVal command, ByVal args)\n');
document.write(
' call sampleFlaMovie_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write('</SCRIPT\> \n');
}
//-->
</SCRIPT>
|
Good luck |
|
| Back to top |
|
 |
dazz_club 250+ Club

Joined: 15 Jul 2005 Posts: 313 Location: Chester and Hull
|
Posted: Wed Mar 08, 2006 5:06 pm Post subject: java now working |
|
|
Hi there,
Sorry for the late reply and i would like to say thanks, what you told me worked like a treat.
cheers. |
|
| Back to top |
|
 |
|