/    Sign up×
Community /Pin to ProfileBookmark

getElementById(id) – IE7 issue

I’ll try and explain briefly here: Problem only on IE7.
I am passing a variable from Flash to an HTML form. I have some javascript code that captures this variable and displays it in an html input text field.
[B]Here is the javascript:[/B]

[CODE]<script language=”javascript”>
function setVal(id,val) {
var field = document.getElementById(id);
field.value = val;
}
</script>[/CODE]

[B]Here is the Flash (actionscript) variable code:[/B]

[CODE]ExternalInterface.call(“setVal”,’rgb’,display_txt.text);[/CODE]

[B]Here is the html input text box:[/B]

[CODE]<input type=”text” name=”file_name_show” id=”rgb” value=”<? echo $rgb;?>”>[/CODE]

[B]And here’s the FlashVars on the html page:[/B]

[CODE]fo.addParam(“FlashVars”, “&rgb=<?php echo $rgb; ?>&”);[/CODE]

What I’m doing is using Flash to upload a file, then grabbing the filename and displaying it in an html text box so I can pass it from page to page with PHP.
This works perfectly in IE6, FF, ect… But NOT in IE7 !
It is a known issue with IE7 that “getElementById(id)” has a bug. I need to know how to fix this please.

[B]You can see a striped down example here:Try It ![/B]
[URL=”http://www.poprocketpress.com/ad_uploads/test/flash_uploader.php”]http://www.poprocketpress.com/ad_uploads/test/flash_uploader.php[/URL]

Thanks for any help,

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@cgishackFeb 14.2008 — worked for me in IE6 , IE7 and FF
Copy linkTweet thisAlerts:
@launchpad67aauthorFeb 14.2008 — worked for me in IE6 , IE7 and FF[/QUOTE]
Thanks for the reply. Yes I know it works in IE6 and FF, it's just IE7 where it doesn't, at least on my clients machine.

What settings in IE7 could be causing my client to Not be able to make this work? What version of IE7 are you running?

I just installed Virtual PC 2007 so I can run IE7 and 6 side by side for testing. But I can't get flash player to install on IE7 on the virtual machine side so I'm stuck.

Thanks again,
Copy linkTweet thisAlerts:
@cgishackFeb 14.2008 — This software will also allow you to install IE 3-> 6 if you have IE 7 installed

http://tredosoft.com/Multiple_IE

I have 7.0.5730.11

what error is your client getting ?

Drew
Copy linkTweet thisAlerts:
@launchpad67aauthorFeb 14.2008 — My client isn't getting an error, just the filename is Not being pushed into the html text box. I haven't been to his house to try it on his machine yet, so I don't know if it's a specific config issue with his computer or just IE7. Like I said, it works on everything else I have tried just fine. He downloaded FF last night and it's works great on that browser.

During my research to figure out this problem (before I posted here), the "document.getElementById(id);" is a known issue and is talked about around the interent. I just couldn't find a solution for it.
×

Success!

Help @launchpad67a spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...