9 Replies - 746 Views - Last Post: 16 February 2013 - 03:21 AM

#1 Maltese  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-February 13

having problem to resize the java drop down menu box

Posted 15 February 2013 - 06:40 AM

hi dude, I'm trying to add the script into my html page as shown below:
it works fine, but just wondering how to resize the drop down box?
each time while i am trying to put style in it, it doesn't work properly and the java script doesn't work as well.
but once i've remove the style, everything works fine.


<form action="#">
<div id="x">
// repeat below code
1. <select onchange="listSel(this,'x')">
<option value=" " selected="selected"></option>
<option value="A">Option One</option>
<option value="B">Option Two</option>
<option value="C">Option Three</option>
<option value="D">Option Four</option>
</select>
// repeat above code
<input type="button" value="reset" onclick="resetSel('x',
[[' ',' '],['A','Option One'],['B','Option Two'],
['C','Option Three'],['D','Option Four']])">
</div>
</form>


THANK YOU!

This post has been edited by Dormilich: 15 February 2013 - 08:51 AM
Reason for edit:: please use [CODE] [/CODE] tags when posting code


Is This A Good Question/Topic? 0
  • +

Replies To: having problem to resize the java drop down menu box

#2 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: having problem to resize the java drop down menu box

Posted 15 February 2013 - 07:19 AM

Well, you could use a class like this for the selector and then change the CSS accordingly.

<select onchange="listSel(this,'x')" class="resize">


CSS

.resize
{
  width:200px;
}


And yes, from next time onwards, please post the code in the code tags provided...also please avoid creating multiple posts for the same topic.

regards,
Raghav

This post has been edited by raghav.naganathan: 15 February 2013 - 07:21 AM

Was This Post Helpful? 1
  • +
  • -

#3 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: having problem to resize the java drop down menu box

Posted 15 February 2013 - 07:29 AM

One more thing I would like to tell you...always use

<!-- your comment here --> for HTML tags.

The /*comment */ can be used for the CSS part and the javascript.

regards,
Raghav

This post has been edited by raghav.naganathan: 15 February 2013 - 07:30 AM

Was This Post Helpful? 0
  • +
  • -

#4 Maltese  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-February 13

Re: having problem to resize the java drop down menu box

Posted 15 February 2013 - 08:55 AM

THANK YOU MAN, i will try later on!!! cheers bro!

This post has been edited by Dormilich: 20 February 2013 - 07:10 AM
Reason for edit:: removed unnecessary quote

Was This Post Helpful? 0
  • +
  • -

#5 Maltese  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-February 13

Re: having problem to resize the java drop down menu box

Posted 15 February 2013 - 09:22 AM

#3 raghav.naganathan

one more question: how to place the drop down box next to the text?
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3809
  • View blog
  • Posts: 13,508
  • Joined: 12-December 12

Re: having problem to resize the java drop down menu box

Posted 15 February 2013 - 12:09 PM

View PostMaltese, on 15 February 2013 - 09:22 AM, said:

#3 raghav.naganathan

one more question: how to place the drop down box next to the text?

Next to what text..? SELECTs are inline elements by default, so it will sit next to other inline elements (SPANs, INPUTs, etc.) unless you have changed this behaviour in your CSS.
Was This Post Helpful? 1
  • +
  • -

#7 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: having problem to resize the java drop down menu box

Posted 15 February 2013 - 12:14 PM

Well, I don't seem to understand what text you are referring to here...

Well, I think you mean to use <div> tags for that...well...by default, <Select> tag will be placed next to the other elements...

Edit : Well, I have to say andrewsw was way quicker than me and spot on, as usual :)

regards,
Raghav

This post has been edited by raghav.naganathan: 15 February 2013 - 12:14 PM

Was This Post Helpful? 0
  • +
  • -

#8 Maltese  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 15-February 13

Re: having problem to resize the java drop down menu box

Posted 15 February 2013 - 01:43 PM

say i need to add a p tag next to the drop box,
<p>text</p>(then i drop box nearby here)
Was This Post Helpful? 0
  • +
  • -

#9 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3809
  • View blog
  • Posts: 13,508
  • Joined: 12-December 12

Re: having problem to resize the java drop down menu box

Posted 15 February 2013 - 01:47 PM

View PostMaltese, on 15 February 2013 - 01:43 PM, said:

say i need to add a p tag next to the drop box,
<p>text</p>(then i drop box nearby here)

P-elements are block-level elements, so the paragraph will drop onto the line below. Use an inline element to contain your text, such as a SPAN. If it is a description, or instruction, relevant to the SELECT, then use a LABEL.

This post has been edited by andrewsw: 15 February 2013 - 01:48 PM

Was This Post Helpful? 1
  • +
  • -

#10 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3809
  • View blog
  • Posts: 13,508
  • Joined: 12-December 12

Re: having problem to resize the java drop down menu box

Posted 16 February 2013 - 03:21 AM

BTW It is Javascript NOT java: Java is a different language.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1