Skip to main content
Inspiring
Jul 13, 2006 3:55 PM UTC
Question

Check checkbox based on URL variable

Hi all,

It's late afternoon and my brain is fried. I know what I want to do is
simple but it escapes me right now....

I want to check a checkbox 'ORDER' in a form if a URL variable 'BROCHURE'
passed to the page has a value of 'INTRODUCTION'.

Can anyone remind me how to do this?

Thanks!


This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
Jul 14, 2006 9:54 AM UTC
Many thanks Joe. It did the trick :o)

"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns97FF92AF64921makowiecatnycapdotrE@216.104.212.96...
> On Thu 13 Jul 2006 11:57:29a, Mintyman wrote in
> macromedia.dreamweaver.appdev:
>
>> It's late afternoon and my brain is fried. I know what I want to do is
>> simple but it escapes me right now....
>>
>> I want to check a checkbox 'ORDER' in a form if a URL variable
>> 'BROCHURE' passed to the page has a value of 'INTRODUCTION'.
>>
>> Can anyone remind me how to do this?
>
> Depends on your serverside language.
>
> PHP:
>
> <input name="checkbox" type="checkbox" value="checkbox"
> <?php if ($_REQUEST['ORDER']=='INTRODUCTION') echo 'checked="checked"'; ?>
>>
>
> ASP/VBScript:
>
> <input name="checkbox" type="checkbox" value="checkbox"
> <% IF (Request.Querystring("ORDER") = "INTRODUCTION") THEN Response.Write
> " checked='checked'" END IF %>
>>


Translate
Inspiring
Jul 13, 2006 6:25 PM UTC
On Thu 13 Jul 2006 11:57:29a, Mintyman wrote in
macromedia.dreamweaver.appdev:

> It's late afternoon and my brain is fried. I know what I want to do is
> simple but it escapes me right now....
>
> I want to check a checkbox 'ORDER' in a form if a URL variable
> 'BROCHURE' passed to the page has a value of 'INTRODUCTION'.
>
> Can anyone remind me how to do this?

Depends on your serverside language.

PHP:

<input name="checkbox" type="checkbox" value="checkbox"
<?php if ($_REQUEST['ORDER']=='INTRODUCTION') echo 'checked="checked"'; ?>
>

ASP/VBScript:

<input name="checkbox" type="checkbox" value="checkbox"
<% IF (Request.Querystring("ORDER") = "INTRODUCTION") THEN Response.Write
" checked='checked'" END IF %>
>
Translate