Javascript

I have a page with some javascript on it, and I need to modify it so that
it will work if JS is turned off in the user’s browser.

What I have is a list of items each with a checkbox. If the checkbox is
clicked, the form submits itself.

What I want to do is: if javascript is not enabled in the browser, don’t
print the checkbox, but instead print a hyperlink. Something like:

if( javascript == “on”) { print “<INPUT TYPE=checkbox NAME=“name”
onclick=“doSomething(param1, param2);” CHECKED>”; }else{ if(already on) {
print “<a href=“page.php?param1=this&param2=that”>Add</a>”; }else{ print
“<a href=“page.php?param1=this&param2=that”>Remove</a>”; } }

How would I go about doing this client side?

-Mike K.

Mike King wrote:
> What I want to do is: if javascript is not enabled in the browser, don’t
> print the checkbox, but instead print a hyperlink.

I don’t know JS, but here goes:

<script LANGUAGE=“JavaScript”> <!-- document.write(“Html for JS
users”);//–> </script> <noscript> HTML for non-JS users. </noscript>

> How would I go about doing this client side?

For the Add or Remove link, you’ll need to do that as server-side.

     ___________ ===================================================
     ___ /_/ / / / / Kevin Gilbertson - mail@gilby.com
     <a href="http://gilby.com/">http://gilby.com</a> / _ '/ / / _'\_ / ICQ: 12611076 AIM/AOL:
     UnicyclingGilby \_ /_/_/,___/ / Free e-Mail and Webspace at
     <a href="http://www.unicyclist.com/">http://www.Unicyclist.com</a> /\/ /__________/ Original Unicycling
     T-shirts <a href="http://gilby.com/t-shirts">http://gilby.com/t-shirts</a> \__/
     ========================================================

Yeah, I figured out the <noscript> thing about 2 minutes after posting
:slight_smile: Guess I should have done a little research first

-Mike K.

Kevin Gilbertson wrote:
>
> Mike King wrote:
> > What I want to do is: if javascript is not enabled in the browser,
> > don’t print the checkbox, but instead print a hyperlink.
>
> I don’t know JS, but here goes:
>
> <script LANGUAGE=“JavaScript”> <!-- document.write("Html for JS
> users");//–> </script> <noscript> HTML for non-JS users. </noscript>
>
> > How would I go about doing this client side?
>
> For the Add or Remove link, you’ll need to do that as server-side.
> –
> ___________ ===================================================
> ___ /_/ / / / / Kevin Gilbertson - mail@gilby.com
> http://gilby.com / _ ‘/ / / _’_ / ICQ: 12611076 AIM/AOL:
> UnicyclingGilby _ ///,___/ / Free e-Mail and Webspace at
> http://www.Unicyclist.com // /__________/ Original Unicycling
> T-shirts http://gilby.com/t-shirts __/
> ========================================================