Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Check checkbox based on URL variable

LEGEND ,
Jul 13, 2006 Jul 13, 2006
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!


TOPICS
Server side applications
496
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 13, 2006 Jul 13, 2006
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2006 Jul 14, 2006
LATEST
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines