Hi guys,
I see you're all still providing excellent guidance here so I thought I would ask for some again.
I have several html pages that rely on javascript functions to build dynamic select content AND control the display of certain fields using the hide/inline attributes. They work fine except I'm having issues with one of the functions NOT being triggered.
On a select list I'm using an onChange trigger and this works just fine on the current page. Then when the user submits the current page and I redisplay the previous page with the embedded select I use an onLoad on the body tag. I pass a parameter to the referenced function to be used as an argument to determine which function(s) to be called/executed. Firebug shows the functions being called, the values passed correctly and I see no errors but one of the function's results don't seem to work.
Here's a snippet of the page's body tag:
<body onload="onLoadfunction('$_fld1', '$_fld2','$_fld3','$_fld4','$_fld5');">
And the called function:
function onLoadfunction(fld1, fld2, fld3, fld4, fld5) {
if (fld1 <= '2') { getList(fld2, fld3, fld4, fld5); }
if (fld1 >= '2') { getInfo(fld3, fld4, fld5); }
As you can see the first field passed to the <body> tag if is set to a '2' then BOTH other functions should be called passing the corresponding parameters.
Of course the function and fields names have been changed to protect the innocent (grin).
Perhaps this sounds wonky but I can't think of any other method to accomplish this need. So if anyone has any suggestions as to an alternate way, I sure would appreciate hearing it.
Thanks again and I look forward to all your responses.
I see you're all still providing excellent guidance here so I thought I would ask for some again.
I have several html pages that rely on javascript functions to build dynamic select content AND control the display of certain fields using the hide/inline attributes. They work fine except I'm having issues with one of the functions NOT being triggered.
On a select list I'm using an onChange trigger and this works just fine on the current page. Then when the user submits the current page and I redisplay the previous page with the embedded select I use an onLoad on the body tag. I pass a parameter to the referenced function to be used as an argument to determine which function(s) to be called/executed. Firebug shows the functions being called, the values passed correctly and I see no errors but one of the function's results don't seem to work.
Here's a snippet of the page's body tag:
<body onload="onLoadfunction('$_fld1', '$_fld2','$_fld3','$_fld4','$_fld5');">
And the called function:
function onLoadfunction(fld1, fld2, fld3, fld4, fld5) {
if (fld1 <= '2') { getList(fld2, fld3, fld4, fld5); }
if (fld1 >= '2') { getInfo(fld3, fld4, fld5); }
As you can see the first field passed to the <body> tag if is set to a '2' then BOTH other functions should be called passing the corresponding parameters.
Of course the function and fields names have been changed to protect the innocent (grin).
Perhaps this sounds wonky but I can't think of any other method to accomplish this need. So if anyone has any suggestions as to an alternate way, I sure would appreciate hearing it.
Thanks again and I look forward to all your responses.