/    Sign up×
Community /Pin to ProfileBookmark

annoying ie only problem with dropdowns

I am developing a websurvey and getting some annoying IE only behavior. I have dropdowns with an OnChange() to either display or hide a table row, via javascipt, based on its value. When I select the dropdown value with the mouse to either hide or display the row the screens flashes quickly like a refresh. This does NOT occur when you select the dropdown using the keyboard. This only occurs in IE, Mozilla and Netscape are both nice and smooth, like IE using the keyboard. I put up an example of this at [url]www.pannatech.com/test/combotest.php[/url]. All the onchange function does is set the style.display of the row to with ‘none’ or ”.

this is the function:

function chk4b01(field)
{
var allvname=field.name
var vlen=allvname.length-1
var basename=allvname.substring(0,vlen);
if (field.value==”2″)
{
document.getElementById(basename).style.display = ”;
}
else
{
document.getElementById(basename).style.display = ‘none’;
}

}

While a little annoyance, it adds up quickly if it occurs a bunch of times when you are going through a survey.

Any ideas?

I am really getting tired of IE annoyances when programming, it almost seems you are develping two products, one for ie and one for all other browsers.

Peter

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@felgallNov 16.2007 — I am really getting tired of IE annoyances when programming, it almost seems you are develping two products, one for ie and one for all other browsers.[/QUOTE]

You are since IE only runs vbScript and JScript and doesn't run JavaScript while other browsers only run JavaScript and not JScript or vbScript. Fortunately there is a subset of JScript that is close enough to JavaScript to allow the same code to work for both at least for some things and we can then use feature sensing to test which version of code to run for most of the instances where they are different. For the rare occasions where we can't distinguish between the two using feature sensing we can use JScript conditional comments which allow us to test if the browser is running JScript (and which are treated as comments by JavaScript).
×

Success!

Help @pvava 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.28,
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,
)...