The Most Active and Friendliest
Affiliate Marketing Community Online!

“AdsEmpire”/  Direct Affiliate

HTML form elements

lala56

New Member
affiliate
Hi there,

In a new form I would love to have exactly the same lenght for my single and multiline text areas. As you specify the width for the first one as "size" and the second one with "cols" I wondered how you would match the exact size? Is there any chance of also having a drop-down menu exactly the same length?

It would be great if someone could help me out on this one ...:)

lala
 
Hi lala ,

For the first thing , I think you can test , you add another col - test it , you add another one , test it

Here is a pice of code , try it

<form id="form1" method="post" action="">
<p>
<label>name <br />
<input name="textfield" type="text" size="22" />
</label>
<label>email <br />
<input type="text" name="textfield2" size="22"/>
</label>
</p>
<p>
<label>text<br />
<textarea name="textarea" cols="22" rows=""></textarea>
</label>
</p>
</form>

actually size is equal to cols , but you have that another part with the scroll, so if you want your text area to be the same with the other field even if you have that scroll , you can use this :

<form id="form1" method="post" action="">
<p>
<label>name <br />
<input name="textfield" type="text" size="22" />
</label>
<label>email <br />
<input type="text" name="textfield2" size="22"/>
</label>
</p>
<p>
<label>text<br />
<textarea name="textarea" cols="19" rows=""></textarea>
</label>
</p>
</form>

For the drop down menu I can`t tell you anything because I`m not a JS knowner , yet , if you want to use

<label>test 1
<select name="select" multiple="multiple">
<option>test 1 </option>
<option>test 2 </option>
<option>test 3 </option>
</select>
</label>

The option group takes the size of the text present withing <option> </option> codes.

Hope this was useful for you , I don`t know for sure if it`s what you need .
 
You welcome, hope that helped you. I think the best way to learn is to try , if you try once you get a result , the second time you try you get another result and so on. I also think it would be a good idea to use dw , you can see your results faster.
 
You could also use CSS to control the width. I know that the cols and rows attribute for a textarea is different than it is for input types. If you set the width using CSS, you can make them look the same.
 
Cheers :p

I will try that as well and compare the results.

You are right. Best is really "learning by doing". You can achieve most things (if not all) when you sit down and try to work it out. Also, the great thing is that there are places like this one, where nice chaps as you guys help out the intellectually disadvantaged ;)

Thank you,
lala :D
 
banners
Back