how do you change Font size in php forms?

  • (2 Pages)
  • +
  • 1
  • 2

21 Replies - 10838 Views - Last Post: 30 March 2011 - 06:40 AM

#1 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

how do you change Font size in php forms?

Posted 30 March 2011 - 02:41 AM

I want to change the size of the font for email, subject and message but I can't see anywhere to do this...

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail("email", "$subject",
  $message, "From:" . $email);
  echo "Thanks for sending us a message,";
  header( 'Location: send_contact.php' ) ;
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text'/><br />
  Subject: <input name='subject' type='text'/><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' VALUE='Send' size='3' />
  </form>";
  }
?>


I tried using the 'size' attribute but it just changed the size of the field.

thanks

Is This A Good Question/Topic? 0
  • +

Replies To: how do you change Font size in php forms?

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3397
  • View blog
  • Posts: 9,599
  • Joined: 08-June 10

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 02:44 AM

the size attribute in a text field determines the number of characters to be displayed (matter of definition).

changing the font size in HTML is done via CSS (font-size, line-height, width, height (may require display block, inline-block or float)).

This post has been edited by Dormilich: 30 March 2011 - 02:45 AM

Was This Post Helpful? 0
  • +
  • -

#3 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 02:56 AM

but I'm using PHP so it doesn't use the css...
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3397
  • View blog
  • Posts: 9,599
  • Joined: 08-June 10

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 03:03 AM

PHP has nothing to do with it. HTML layout (that what you see) occurs on the client/browser, PHP is a server-side programming language and has long been finished processing when the browser builds the layout.
Was This Post Helpful? 0
  • +
  • -

#5 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 03:05 AM

View PostDormilich, on 30 March 2011 - 03:03 AM, said:

PHP has nothing to do with it. HTML layout (that what you see) occurs on the client/browser, PHP is a server-side programming language and has long been finished processing when the browser builds the layout.


but there is no HTML as its a script
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3397
  • View blog
  • Posts: 9,599
  • Joined: 08-June 10

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 03:06 AM

lines #17 to #24 suspiciously look like HTML to me.
Was This Post Helpful? 0
  • +
  • -

#7 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 03:13 AM

View PostDormilich, on 30 March 2011 - 03:06 AM, said:

lines #17 to #24 suspiciously look like HTML to me.


Its using no HTML its completely PHP,(or so I assume) if it is HTML how do I implement that into my CSS??

EDIT: I do apoligise it is HTML! so like with tables you can add style tab to the start, can I do this with the form??

This post has been edited by Addio569: 30 March 2011 - 03:15 AM

Was This Post Helpful? 0
  • +
  • -

#8 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 03:51 AM

I tried added this to the CSS:

forma {
         font-family: garamond, times new roman;
	 font-size: 20px;
         }




but I have no labelcells to amend:

 echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text'/><br/><br/>
  Subject: <input name='subject' type='text'/><br/><br/>
  Message:<br />


can I add them?
Was This Post Helpful? 0
  • +
  • -

#9 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3397
  • View blog
  • Posts: 9,599
  • Joined: 08-June 10

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 04:05 AM

forma is not an HTML element! you can use input[type="text"] { /* */ } that would affect all text boxes.
Was This Post Helpful? 0
  • +
  • -

#10 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 04:16 AM

View PostDormilich, on 30 March 2011 - 04:05 AM, said:

forma is not an HTML element! you can use input[type="text"] { /* */ } that would affect all text boxes.


sorry its the labels I would like to change, just the text size as their a little small. but I can't see anywhere to change their attributes
Was This Post Helpful? 0
  • +
  • -

#11 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3397
  • View blog
  • Posts: 9,599
  • Joined: 08-June 10

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 04:21 AM

label { /* CSS code here */ } ?

EDIT:
ah, I understand the problem. wrap your labels in <label> tags.

This post has been edited by Dormilich: 30 March 2011 - 04:22 AM

Was This Post Helpful? 0
  • +
  • -

#12 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 04:45 AM

View PostDormilich, on 30 March 2011 - 04:21 AM, said:

label { /* CSS code here */ } ?

EDIT:
ah, I understand the problem. wrap your labels in <label> tags.


will that still work with the php?

and would I implement that like this?

<label>Email:</label> <input name='email' type='text'/><br/><br/>


thanks

This post has been edited by Addio569: 30 March 2011 - 04:45 AM

Was This Post Helpful? 0
  • +
  • -

#13 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3397
  • View blog
  • Posts: 9,599
  • Joined: 08-June 10

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 04:49 AM

still nothing to do with PHP

better implementation:
<!-- CSS can even make the line breaks for you -->
<!-- cf. http://articles.sitepoint.com/article/fancy-form-design-css -->
<label for='email'>Email:</label> <input name='email' id='email' type='text'>

Was This Post Helpful? 1
  • +
  • -

#14 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 04:52 AM

View PostDormilich, on 30 March 2011 - 04:49 AM, said:

still nothing to do with PHP

better implementation:
<!-- CSS can even make the line breaks for you -->
<!-- cf. http://articles.sitepoint.com/article/fancy-form-design-css -->
<label for='email'>Email:</label> <input name='email' id='email' type='text'>


that website is very helpful, thanks I'll give it a go!
Was This Post Helpful? 0
  • +
  • -

#15 Addio569  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 316
  • Joined: 26-November 08

Re: how do you change Font size in php forms?

Posted 30 March 2011 - 05:52 AM

View PostAddio569, on 30 March 2011 - 04:52 AM, said:

View PostDormilich, on 30 March 2011 - 04:49 AM, said:

still nothing to do with PHP

better implementation:
<!-- CSS can even make the line breaks for you -->
<!-- cf. http://articles.sitepoint.com/article/fancy-form-design-css -->
<label for='email'>Email:</label> <input name='email' id='email' type='text'>


that website is very helpful, thanks I'll give it a go!


ok so I sort of got it how I want it but i'm having trouble lining up the text boxes next to the labels, my code is:

  echo "<form method='post' action='mailform.php'>
  <fieldset>
  <label for='email'>Email:</label> <input name='email' type='text' size='25'/>
  <label for='subject'>Subject:</label><input name='subject' type='text' size='25'/>
  <label for='message'>Message:</label><br/>
  <textarea name='message' rows='15' cols='40'>
  </textarea><br/>
  <input type='submit' VALUE='Send' size='3' />
  </fieldset>
  </form>";


and the css is:

fieldset{
             background: #F7E7CE;
             border: 1px solid #F7E7CE;
             width: 20em
              }

label {
         font-family: garamond, times new roman;
	 font-size: 20px;
         display: block;
         float: left;    
         width: 10em;    
        margin-right: 1em; 
          }




I want the label on the same line as the text box (except the message one) I'm trying to follow the guide you sent me but I can see what to change, there code is:

left-aligned-labels.css (excerpt)  
fieldset li {    
float: left;    
clear: left;    
width: 100%;    
padding-bottom: 1em;  
}


but I can't see a how you implement it??
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2