CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 javascript help appreciated

Print topic Send  topic

Author Message
keijen
Posted: 08/01/2002, 11:54 PM

CC 2.05
ASP & templates

A bit off topic here I suppose, but learner would appreciate some javascript
help.

Form name: iat1b
One radio button set, name StatRad
Five checkboxes, names of PriCheck1, PriCheck2, PriCheck3 etc.

If user checks any checkbox, I need to switch off any previously selected
radio button.
If any checkbox is checked, radio buttons should be disabled until any/all
checkboxes cleared.

Default state on load of page is all unchecked.

Any javascript afficionadoes care to show me the script(s) - and where I'd
put them?

TIA
banjo

Shawn Mason
Posted: 08/02/2002, 10:18 PM

Welcome to the world of javascript. what you are wanting is not as easy as
it may seem.
- make the fields (radio button, checkbox) labels and check the "html"
attribute
- you need to write the vbScript code to dynamically create these because
you need to add the "onchange" event (of couse you could modify the html
template instead but I only do that as a last resort)
- the javascript function that the onchange event refers to will then do the
changes on the form as you need it to. It refers to controls as
document.formname.controlname.specificFunctionNeeded.
- I hardily recommend a good javascript book and some time...

The most frustrating part I find in javascipting is the lack of debug
features and the lack of good error return codes. I just finished a page
where the user changes a drop down and the pages refreshes with the data
from the record in the dropdown and the javascript took about 75% of the
entire time. Considering taking the time to post it on www.gotocode.com if
I can find the time.

--
Kindest Regards,

Shawn Mason,CCD,MCP
I.S. Software Design Associates

"keijen" <keijen@ozemail.com.au> wrote in message
news:aidabm$d7m$1@news.codecharge.com...
> CC 2.05
> ASP & templates
>
> A bit off topic here I suppose, but learner would appreciate some
javascript
> help.
>
> Form name: iat1b
> One radio button set, name StatRad
> Five checkboxes, names of PriCheck1, PriCheck2, PriCheck3 etc.
>
> If user checks any checkbox, I need to switch off any previously selected
> radio button.
> If any checkbox is checked, radio buttons should be disabled until any/all
> checkboxes cleared.
>
> Default state on load of page is all unchecked.
>
> Any javascript afficionadoes care to show me the script(s) - and where I'd
> put them?
>
> TIA
> banjo
>
>

RonB
Posted: 08/04/2002, 2:46 PM

Just a try:
put this in the head section of the html
I'm assuming checked value=1 unchecked is 0 for the checkboxes
<script language="JavaScript">
function checkbox()
{

if(document.all["PriCheck1"].value==1||document.all["PriCheck2"].value==1||d
ocument.all["PriCheck3"].value==1)
{
document.all["StatRad"].value=""
}
}
</script>

now you have to apply this function in both the checkboxes and the
radiobutton.
now in the body section look up the checbox parts and the radiobutton part
and in the <input..... section add:

onchange="checkbox()"

when you put this in both checkbox and radiobutton part you are sure it will
do what you want.

I haven't checked if it works but I think it will

RonB


"keijen" <keijen@ozemail.com.au> schreef in bericht
news:aidabm$d7m$1@news.codecharge.com...
> CC 2.05
> ASP & templates
>
> A bit off topic here I suppose, but learner would appreciate some
javascript
> help.
>
> Form name: iat1b
> One radio button set, name StatRad
> Five checkboxes, names of PriCheck1, PriCheck2, PriCheck3 etc.
>
> If user checks any checkbox, I need to switch off any previously selected
> radio button.
> If any checkbox is checked, radio buttons should be disabled until any/all
> checkboxes cleared.
>
> Default state on load of page is all unchecked.
>
> Any javascript afficionadoes care to show me the script(s) - and where I'd
> put them?
>
> TIA
> banjo
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.