Forum Moderators: open

Message Too Old, No Replies

javascript function recycle, pointing into an iframe

javascript function recycle

         

mdrdlp

3:31 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



i guess first, i should say hello... new here.

ok... i am having some troubles in accomplishing what i thought would be a menial task to script. (i was wrong) the basics:

i have a drop down form that is dynamically populated via php. a simple snippet from one of the forms:

<select name=ab value=\"$ab\" onChange='javascript:recycle(this.form);'>
<option value=1 "; if ($ab==1) {echo "selected";} echo ">1</option>

etc etc etc

when an option is selected, i have it calling a javascript:

<script>
function recycle(form) {
document.location="/mypage.php?ab="+form.ab.value+"&ac="+form.ac.value+"&ad="+form.ad.value+"&ae="+form.ae.value+"\n";
return true;
}
</script>

now... standing alone, this works perfectly. when i select an option, mypage.php?(variable) is rendered with the results of whatever the option that was selected is. the twist, and part i am having an issue with, is i need this to target an iframe. when an option is selected, the iframe on the CURRENT page is targeted, and changed. i thought i could do this by simply adding a getdocumentsbyID reference, but that hasnt seemed to work or i have done it incorrectly. (if that is way off base, dont laugh.... i'm not a javascript guru. ha)

can anyone offer any assistance or input? would sincerely appreciate it.

mdrdlp

4:03 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



crap... nevermind. had another issue i didnt think about (affects history by loading a new page into the iframe... cant do it) so.. back to square 1.