Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Fixing the width of select box in IE



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> HTML Forum
View previous topic :: View next topic  
Author Message
java.qc@gmail.com



Joined: 29 May 2008
Posts: 3

PostPosted: Thu May 29, 2008 12:45 pm    Post subject: Fixing the width of select box in IE Reply with quote

Hi ,
I m facing the problem with fixing the width of select box on my html page but option list should be expended to a fix width as required. My problem is my select list should be fix but option list can expand .Attached is the code that is working fine on Mozila but on IE it is not working as required .Plz help me out to make it work properly on IE.

<html>
<script type="text/javascript">
<!-- begin hiding
function expandSELECT(sel)
{
sel.style.width = '200px';

}


function contractSELECT(sel) {
hi();
sel.style.width = '100px';
}
// end hiding -->

function hi()
{
for (var i = 0; i<document.forms[0].test.length;i++)
{
if(document.forms[0].test.options[i].selected== true)
{
document.forms[0].test.options[i].selected= true;
break;
}
}

}
</script>


<form>

<select name = "test" width="70" style="width: 100px";"position:absolute"; onfocus=expandSELECT(this)
onblur=contractSELECT(this) >
<option value="1">11111111111111111111111111111111111111111111
<option value="2">2222222222
<option value="3">3333333333333
<option value="4">444
</select>

</form>
</html>[/code]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> HTML Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap