Function won't run on form submit? 
Author Message
 Function won't run on form submit?

I am just experimenting here so I have a very simple form and want to run a
J-Script client side script when I hit the submit button.  I can do the same
with VB script but it won't run on Netscape.  Can anyone here help me out?
Thanks!  Code follows:

<form name="CustDetail2" ONSUBMIT="CustDetail2()">
  <p><input type="submit" value="Submit" name="B2">Java Script Test
Button</p>
</form>

<script LANGUAGE="JavaScript" Type="text/Javascript">
Function CustDetail2()
{
alert("TOK");
return false

Quote:
}

</script>


Fri, 05 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?
I am just experimenting here so I have a very simple form and want to run a
J-Script client side script when I hit the submit button.  I can do the same
with VB script but it won't run on Netscape.  Can anyone here help me out?
Thanks!  Code follows:

<form name="CustDetail2" ONSUBMIT="CustDetail2()">
  <p><input type="submit" value="Submit" name="B2">Java Script Test
Button</p>
</form>

<script LANGUAGE="JavaScript" Type="text/Javascript">
Function CustDetail2()
{
alert("TOK");
return false

Quote:
}

</script>


Fri, 05 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?
Check your case.  Try <form onSubmit="javascript:CustDetail2();">

--
   ______________________________
   aaron bertrand [mvp-asp]
   http://www.swynk.com/friends/bertrand/


Quote:
> I am just experimenting here so I have a very simple form and want to run
a
> J-Script client side script when I hit the submit button.  I can do the
same
> with VB script but it won't run on Netscape.  Can anyone here help me out?
> Thanks!  Code follows:

> <form name="CustDetail2" ONSUBMIT="CustDetail2()">
>   <p><input type="submit" value="Submit" name="B2">Java Script Test
> Button</p>
> </form>

> <script LANGUAGE="JavaScript" Type="text/Javascript">
> Function CustDetail2()
> {
> alert("TOK");
> return false
> }
> </script>



Fri, 05 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?

Quote:

>I am just experimenting here so I have a very simple form and want to run a
>J-Script client side script when I hit the submit button.  I can do the
same
>with VB script but it won't run on Netscape.  Can anyone here help me out?
>Thanks!  Code follows:

><form name="CustDetail2" ONSUBMIT="CustDetail2()">
>  <p><input type="submit" value="Submit" name="B2">Java Script Test
>Button</p>
></form>

><script LANGUAGE="JavaScript" Type="text/Javascript">
>Function CustDetail2()
>{
>alert("TOK");
>return false
>}
></script>

I believe that, in order to actually keep the form from submitting, you have
to do this:
<form .... onSubmit="return CustDetail2()">
Or else the return value is ignored.

Kris Eiben
Automation Creations, Inc.



Fri, 05 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?
Hi

Try it like this:

<script LANGUAGE="JavaScript" Type="text/Javascript">
function vForm(f){
alert("TOK");
return false;

Quote:
}

</script>

<form name="CustDetail" onsubmit="return vForm(this)">
<input type="submit" value="Submit" name="B2">
</form>

--
Best Regards
     Vidar Petursson
http://www.icysoft.com


Admin for  these Mailing Lists
Game Programmers Mailing List
Coders Mailing List
Windows Programmers Mailing List
Copy Protection Mailing List
Tel: +354-557-4809
Mobile/Gsm +354-862-5700
ICQ:8298366

No matter where you go there you are.

Quote:

>I am just experimenting here so I have a very simple form and want to run a
>J-Script client side script when I hit the submit button.  I can do the
same
>with VB script but it won't run on Netscape.  Can anyone here help me out?
>Thanks!  Code follows:

><form name="CustDetail2" ONSUBMIT="CustDetail2()">
>  <p><input type="submit" value="Submit" name="B2">Java Script Test
>Button</p>
></form>

><script LANGUAGE="JavaScript" Type="text/Javascript">
>Function CustDetail2()
>{
>alert("TOK");
>return false
>}
></script>



Fri, 05 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?


Quote:
> Check your case.  Try <form onSubmit="javascript:CustDetail2();">

Check your syntax :)

html event handler attributes like onsubmit are NOT case-sensitive. Also,
since onsubmit is a javascript event handler that implies implicit
javascript usage, you do not place "javascript:" in front of the event
handler. That notation is only used within html attributes like "href", e.g.
<a href="javascript:func()">. For example, the NS <area> tag does not
support an onclick event but it does support mouseover/out so you could use
"javascript:" in the href to simulate an onclick handler.

Hope this helps,

- Oisin



Mon, 08 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?


Quote:
> I am just experimenting here so I have a very simple form and want to run
a
> J-Script client side script when I hit the submit button.  I can do the
same
> with VB script but it won't run on Netscape.  Can anyone here help me out?

Perhaps your problem is simpler than it sounds; if I read you correctly you
are implying that NS should understand VBScript, alas, it does not. Always
use Javascript event handlers.

- Oisin



Mon, 08 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?

Quote:

> <img src="blabla.gif" onclick="mov ax,123; mov bx,456; int 21h"
> type="text/AssemblerScript">
> (God knows what DOS function that assember calls, by the way!)

Space Corps Directive 157826 - "No officer shall build or run randomly
generated assembly code on his own machine."

    But I did it anyway. AFAIK 7B isn't a legit int 21h call, so it didn't
seem to do much of anything. Of course, undocumented functions being what
they are, I probably just overwrote a key byte in a FAT table or something
similarly horrific.
--
Scott Bruno, A+
http://pchelp.interspeed.net
======================



Mon, 08 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?

Quote:



>> Check your case.  Try <form onSubmit="javascript:CustDetail2();">

>html event handler attributes like onsubmit are NOT case-sensitive. Also,
>since onsubmit is a javascript event handler that implies implicit
>javascript usage, you do not place "javascript:" in front of the event
>handler.

If you want to write an event-handler that is NOT in the default scripting
language for the page, you can use the "type" attribute, just as you do for
the <script> tag (as you all know, "language" is deprecated!)

<img src="blabla.gif" onclick="mov ax,123; mov bx,456; int 21h"
type="text/AssemblerScript">

Peter

(God knows what DOS function that assember calls, by the way!)

--
Peter Torr, Developer / Webmaster          Vantage Systems Australia.

JScript FAQ  -   http://www.netspace.net.au/~torrboy/code/jscriptfaq/



Tue, 09 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?

Quote:

>Space Corps Directive 157826 - "No officer shall build or run randomly
>generated assembly code on his own machine."

>    But I did it anyway.

Are you freakin nuts? :-)

Quote:
>AFAIK 7B isn't a legit int 21h call,

Yeah, I sort of thought there weren't that many calls ;-) If I was at home,
I'd look it up in my Norton PC Programmer's Bible, but I'm not, so I won't.

Quote:
>Of course, undocumented functions being what
>they are, I probably just overwrote a key byte in a FAT table or something
>similarly horrific.

Don't re-boot - ever. You may not be able to start it again ;-)

(I used to be dead scared when I was playing around with BIOS sector
read/write code, just in case I screwed up and overwrote the partition table
or something...)

Peter

--
Peter Torr, Developer / Webmaster          Vantage Systems Australia.

JScript FAQ  -   http://www.netspace.net.au/~torrboy/code/jscriptfaq/



Tue, 09 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?


Quote:


> >Space Corps Directive 157826 - "No officer shall build or run randomly
> >generated assembly code on his own machine."

> >    But I did it anyway.

> Are you freakin nuts? :-)

> >AFAIK 7B isn't a legit int 21h call,

Just to be a stickler, the assembly code actually equates to;

mov ax,007b
mov bx, 01c8
int 21h

Note that it is AL that holds 7Bh (AH is important for int 21h), thereby AH
= 0 and we all know what ah=0,int 21h does don't we? (Terminate Program) OK,
so maybe noone else here is an ex-asm head with a penchant for remembering
carried-over CPM calls from DOS 1.0.  The code would do nowt whatsoever. All
you newbies who typed it in can stop worrying now!

- Oisin

p.s. before anyone replies to tell me that "type/assemblerscript" isn't
valid...



Tue, 09 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?
Hi

Quote:

>so maybe noone else here is an ex-asm --

How nice, im a ex-asm head also  not on the pc
though but on the Amiga(Great machine btw)

Best Regards
     Vidar Petursson
http://www.icysoft.com


Admin for  these Mailing Lists
Game Programmers Mailing List
Coders Mailing List
Windows Programmers Mailing List
Copy Protection Mailing List
Tel: +354-557-4809
Mobile/Gsm +354-862-5700
ICQ:8298366

No matter where you go there you are.



Tue, 09 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?

Quote:

> The code would do nowt whatsoever.

    Well now, just to be a stickler: Sorry, but you seem to be wrong. While
it is true that you're supposed to use 4Ch instead (or 31h for a TSR), 0h
does indeed still 'work'. However, since it successfully terminated an .exe
as well as a .com, and since it technically shouldn't terminate an .exe
unless you explicitly load the address of the PSP into CS, and further since
it generated a return code, which according to my documentation it is not
supposed to do, I suspect 0h is remapped internally to 4Ch for
backward-compatibility with DOS 1.0 software.

Quote:
> Al you newbies who typed it in can stop worrying now!

    You can relax, too. Partially because it was a joke to begin with (the
Red Dwarf parody should have tipped you off), and partially because,
speaking as someone who knows there is software floating around the world
with his name on it, I resent the implication of "newbie". Next time you
make a mistake, no matter how trivial, do look me up so I can
call you a newbie. Thanks.

--
Scott Bruno, A+
They can pry my SBN logo from my cold, dead web site
http://pchelp.interspeed.net
======================


Quote:




> > >Space Corps Directive 157826 - "No officer shall build or run randomly
> > >generated assembly code on his own machine."

> > >    But I did it anyway.

> > Are you freakin nuts? :-)

> > >AFAIK 7B isn't a legit int 21h call,

> Just to be a stickler, the assembly code actually equates to;

> mov ax,007b
> mov bx, 01c8
> int 21h

> Note that it is AL that holds 7Bh (AH is important for int 21h), thereby
AH
> = 0 and we all know what ah=0,int 21h does don't we? (Terminate Program)
OK,
> so maybe noone else here is an ex-asm head with a penchant for remembering
> carried-over CPM calls from DOS 1.0.  >
> - Oisin

> p.s. before anyone replies to tell me that "type/assemblerscript" isn't
> valid...



Tue, 09 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?


Quote:

> > The code would do nowt whatsoever.

>     Well now, just to be a stickler: Sorry, but you seem to be wrong.
While
> it is true that you're supposed to use 4Ch instead (or 31h for a TSR), 0h
> does indeed still 'work'. However, since it successfully terminated an
.exe
> as well as a .com, and since it technically shouldn't terminate an .exe
> unless you explicitly load the address of the PSP into CS, and further
since
> it generated a return code, which according to my documentation it is not
> supposed to do, I suspect 0h is remapped internally to 4Ch for
> backward-compatibility with DOS 1.0 software.

Scott, given that putting assembly mnemonics into a HTML event handler in
ie4/5 (which is the context of the discussion and not dos 1 nor dos 3.2 nor
any dos version whatsover) will only cause run-time errors (unless you've
named your js functions after mnemonics) we are both ultimately wrong. I
wasn't attempting to do anything but inject some humour into the thread, and
I was definately not trying to show you up as I do realise you too were only
trying to be humourous.

Quote:
> > All you newbies who typed it in can stop worrying now!

I don't seriously believe that anyone typed it in expecting it to work and I
don't think you believe so either.

Quote:
>     You can relax, too. Partially because it was a joke to begin with (the
> Red Dwarf parody should have tipped you off), and partially because,
> speaking as someone who knows there is software floating around the world
> with his name on it, I resent the implication of "newbie". Next time you
> make a mistake, no matter how trivial, do look me up so I can
> call you a newbie. Thanks.

I didn't need to be tipped off as to the context of your mail, I understood
perfectly that you were joking. I'm sorry and I apologise if you felt my
"newbie" comment was directed at you -- it wasn't directed at anyone and I
hope to be corrected again by yourself in future if I make a mistake, albeit
in a less acrimonious fashion. Thanks.

- Oisin



Fri, 12 Oct 2001 03:00:00 GMT  
 Function won't run on form submit?

Quote:
> Scott, given that putting assembly mnemonics into a HTML event handler in
> ie4/5 (which is the context of the discussion and not dos 1 nor dos 3.2
nor
> any dos version whatsover) will only cause run-time errors (unless you've
> named your js functions after mnemonics) we are both ultimately wrong. I

    Actually I was talking about having built & executed the code with MASM,
but yeah, I guess I wasn't very clear on that. BTW, I don't know if that
is/was your choice of assembler, but the 6.14 patch was recently made
available.

Quote:
> I'm sorry and I apologise if you felt my
> "newbie" comment was directed at you -- it wasn't directed at anyone and I
> hope to be corrected again by yourself in future if I make a mistake,
albeit
> in a less acrimonious fashion. Thanks.

    I apologize as well. Guess I just inferred the wrong 'tone' from what
you'd written, and I responded in what seemed to be a similar fashion. How
about we write it up to, "No harm, no foul"?

--
Scott Bruno



Fri, 12 Oct 2001 03:00:00 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. Image won't submit form

2. Batch file won't run with WshShell.run

3. PS tax forms are bad too -- Re: Acrobat reader won't print IRS tax forms

4. Simple script won't run on certain user's PC

5. Function Form Submit

6. Submit FORM from function

7. problem submitting form from a function

8. submitting a form inside a function ?

9. Netscape 4.7 Won't Execute OnLoad Function

10. iis won't run asp.

11. Ghostscript won't run from script.

12. Why won't javascript run?

 

 
Powered by phpBB® Forum Software