I have a form which can be called as a subform from a parent form, or as a stand alone form straight from the opening menu.
If the form is called from a parent form I have to populate a radio button field. I have tried inheriting a field from the parent form but for some reason this doesn't want to work, possibly due to buggy application software, so this is not an option.
The solution I came up with involves calling a Javascript function when the page opens which works and populates the field:
function pop_how()
{
if (opener.MainForm.Field9999999_2025!=null){
MainForm.Field9992075_5578[2].checked=true;
}
}
This works a treat and allows me to default the field when opened from the parent form.
The problem comes when the form is opened standalone and opener.MainForm is null. How can I fix my function to take this into account?
I have tried changing the test to opener.MainForm!=null and get an error returned that opener.MainForm is not an object.
If the form is called from a parent form I have to populate a radio button field. I have tried inheriting a field from the parent form but for some reason this doesn't want to work, possibly due to buggy application software, so this is not an option.
The solution I came up with involves calling a Javascript function when the page opens which works and populates the field:
function pop_how()
{
if (opener.MainForm.Field9999999_2025!=null){
MainForm.Field9992075_5578[2].checked=true;
}
}
This works a treat and allows me to default the field when opened from the parent form.
The problem comes when the form is opened standalone and opener.MainForm is null. How can I fix my function to take this into account?
I have tried changing the test to opener.MainForm!=null and get an error returned that opener.MainForm is not an object.