javascript getElementById

I’m using the advanced web server and am starting to be frustrated. Is there a way to set misc text items into statements, such as id=. The pbuilder seems to filter out a lot of tags. The “Name” property of the

Ok… I guess I was looking through “View Source”, but even with working webpages, it does not show IDs in the code…

The real question has to do with RpRadioButtonGroup. How do I change the selected radio button through javascript?

document.FwEnableGroup.checked is not a valid option.

Thanks,
Eric

Inside the group you shoud have one RpFormInput for each Radio button (with TYPE=RADIO of course). They all should have the same NAME as the group. Each radio button will have a VALUE=0,1,2… different for each radio button.
Int the Get/Set functions declared in RpRadioButtonGroup, you can set/read the value of the checked button. (If you return the proper value from the Get function, it will check the corresponding button). Set function lets you retrieve the checked button.

Adrian

Get and set won’t happen until a post though, right?
When I click on one of the radio buttons in my browser, it is not going to communicate anything with the digi until post or refresh, correct?

Basically, I’m trying to disable some inputs or buttons when one of the radio buttons is selected and enable when the other one is selected.

Also, I would like to validate items prior to post.

Get happens whenever you are loading the page. Set happens only after a post.

For your problem, declare one (or more) Javascript varriable(s) and call a JS function which will enable/disable your items according to the value(s) of variables.
The variable values will be modified whenever you load or reload the page. You can use a RpDisplayText function for this which will modify the values according to your internal variables. In this way you will have the desired enabling when loading the page.

Additionally, you can use onClick() JS function to enable/disable things when you just switch radio buttons without pressing Submit.

Adrian

right… that’s what I have been trying to do.

I have a function called in onclick(), but I keep receiving errors when I try to check and set form items… invalid objects, etc.

Does anyone have an example of doing this?

Thanks,
Eric

I still couldn’t get the radio ID property to work right, but I don’t why I didn’t think of this before…

I pointed each radio button to a seperate function and passed the object through. These worked!

function enable_fw(obj)
{
if (obj.checked==true)
document.getElementById(‘fwport’).disabled=false;
else
document.getElementById(‘fwport’).disabled=true;
}

function disable_fw(obj)
{
if (obj.checked==true)
document.getElementById(‘fwport’).disabled=true;
else
document.getElementById(‘fwport’).disabled=false;
}