Follow us on Twitter!
Society leans ever heavily on computers, if you have the power to take out computers you can take out society. - cubeman372
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 17
Guests Online: 15
Members Online: 2

Registered Members: 82908
Newest Member: krishna7799
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

Javascript Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-07-07 21:11
<form name="form1">
<select name="S1" size="4"
onchange="document.form1.T1.value ='Cost:' + this.value">
<option value="0.99">Pencil</option>
<option value="3.99">Paper</option>
<option value="4.99">Pens</option>
<option value="1.99">Ruler</option>
<select><BR>
<input type="text" name="T1" value="Pick an item above">
</form>


OK, with that coding, it works fine and everything, but I am trying to change the width/height of the input type value. I can't figure out how to do it. Well, I am like also trying to make it change size depending on the text, and can't manage to figure it out. Google hasn't been help either.
Author

RE: Javascript Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-07-07 21:40
Just set the CSS "width" property to whatever you want... For example:
Code

var blah = document.getElementById("id");
blah.style.width = (10 * yourSelect.value.length) + "px";




Which would make the box big enough for however many characters there are, assuming their all 10 pixels wide.