Jump to content


Photo

font type in drop down list


  • Please log in to reply
1 reply to this topic

#1 seaten

seaten
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 23 March 2006 - 09:13 PM

I want the user to pick a font type, at the moment I have it in check boxes but I prefer to have it in a drop down list.

But the key is to have each font option displayed in their own style. Any Ideas ?


here is my current code:
<b>Choose a Font Style for your Text:</b>
<font face= arial>Arial</font>&nbsp;
<input name="fontType" type="checkbox" id="sel_templateA" value="arial">

<font face="Bookman Old Style">Bookman Old Style&nbsp;</font>
<input name="fontType" type="checkbox" id="sel_templateA" value="Bookman Old Style">

<font face="Comic Sans MS">Comic Sans&nbsp;</font>
<input name="fontType" type="checkbox" id="sel_templateA" value="Comic Sans MS">

<font face="Courier">Courier&nbsp;</font>
<input name="fontType" type="checkbox" id="sel_templateA" value="Courier">

#2 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 24 March 2006 - 08:25 PM

[!--quoteo(post=357775:date=Mar 23 2006, 09:13 PM:name=seaten)--][div class=\'quotetop\']QUOTE(seaten @ Mar 23 2006, 09:13 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I want the user to pick a font type, at the moment I have it in check boxes but I prefer to have it in a drop down list.

But the key is to have each font option displayed in their own style. Any Ideas ?
here is my current code:
<b>Choose a Font Style for your Text:</b>
<font face= arial>Arial</font>&nbsp;
<input name="fontType" type="checkbox" id="sel_templateA" value="arial">

<font face="Bookman Old Style">Bookman Old Style&nbsp;</font>
<input name="fontType" type="checkbox" id="sel_templateA" value="Bookman Old Style">

<font face="Comic Sans MS">Comic Sans&nbsp;</font>
<input name="fontType" type="checkbox" id="sel_templateA" value="Comic Sans MS">

<font face="Courier">Courier&nbsp;</font>
<input name="fontType" type="checkbox" id="sel_templateA" value="Courier">
[/quote]

The two things that I would recommend is not using the <font> tag. It is not widely used anymore and won't validate. Use <span style="font-family:Arial"> instead. Also, I wouldnt use a font like Bookman Old Style as not every user is going to have that font. Stick with Verdana, Trebuchet, Arial, Courier, Tahoma, etc.

For your code have this:

<select name="fontType" id="selTemplateA">
     <option value="Arial" style="font-family:Arial">Arial</option>
     <option value="Tahoma" style="font-family:Tahoma">Tahoma</option>
     <option value="Trebuchet MS" style="font-family:'Trebuchet MS'">Trebuchet MS</option>
</select>

That should work! :)

OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users