W3C home > Mailing lists > Public > www-html@w3.org > October 1998

Re: How to support borwsers with javascript support ?

From: Taco IJsselmuiden <taco@ch.twi.tudelft.nl>
Date: Thu, 15 Oct 1998 10:23:43 +0200 (CEST)
To: Ravindra Sharma <rsharma@marketfirst.com>
cc: www-html@w3.org
Message-ID: <Pine.LNX.3.96.981015102101.3443A-100000@ch.twi.tudelft.nl>
> My web page contains javascript but if a browser does not support
> javascript the onsubmit gives an error saying ValidateForm() not found.
> 
> <form
> action="http://harp.marketfirst.com/watchfirst/CTIISPlugin.dll?watchfirst"
> method="post" name="Follow-up Drop of Application/Solicitation of
> Subscription"
> onsubmit="return ValidateForm()">
> 
> I could avoid the javascript portion with using comment
> <script language="JavaScript">
> <!-----------
> 
> Java script functions ...
> 
> // ---------->
> </script>
> 
> But the onSummit can not commented ? Is there a way ?
Sure, you could do something like this:
<form
action="someaction"
method="post" name="somename"
<script language="JavaScript">
<!--// hide this
document.write('onSubmit="return ValidateForm()"
//-->
</script>
>

(don't forget the > after </script> )
if a browser supports javascript, it writes the onSubmit, if not, it
doesn't.

Greetz,
Taco.
                  \|||/
                 ( o o )
                  \ V /
---------oOOOo-----| |-----oOOOOo---------
           |     T//-\\co    |
           -------------------
Anyone who reads THIS twice is MAD !!
Voice: (+31) 070-4279822
E-Mail: taco@ch.twi.tudelft.nl
Homepage: http://ch.twi.tudelft.nl/~taco/
Received on Thursday, 15 October 1998 04:22:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:37 GMT