Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Issues with my Form fields....

Featured Replies

Hi!

Im having trouble with a website i am designing currently. I have only started to learn HTML / CSS etc in the past couple of months so bear with me!
On the contact me page, the data entry fields will run a 1/3rd of the way into the next div (the white space), this only happens on my samsung, kindle fire and older browsers, it works fine on apple iphones, ipads, firefox and iexplorer the later versions....ive searched for an answer but havent been able to find what im looking for currently....

i'll add what i can below.....

ive attached 2 photos of the problem, one working in IE9, one not working on the kindle fire.

page link - www.ihost-design.com/bensmith/contact.php

html....
< div id="c4b1">

< !-- Start of PHP code for email form validation -->
<?
$s=$_GET['s'];
if ($s=="1") {
echo('<span class="success">Success! Your message has been sent and we will try to reply within 48 hours.</span>');
}
else if ($s=="2") {
echo('<span class="fail">An error occured. Your message was NOT sent, please try again ensuring the security question has been answered.</span>');
}
?>
<!-- End of PHP -->
<br><font color="#ffff00"><u>CONTACT US:</u></font>
<p>If you have any queries, require more specific information or to book a session with any of our health care professionals or sports industry specialists please contact:-<br>
<br>
<font color="#ffff00"><u>Paul Harley</u></font> - 07930695408 or 0115 9538852<br>
<font color="#ffff00"><u>Email</u></font> : <a href="mailto:paul@phitforall.co.uk">paul@phitforal l.co.uk</a><br>
Follow us on FACEBOOK to find out about our latest offers..<br>
<br>
Or alternatively use our easy contact form and we will aim to contact you within 24 hours.
<p><br>

<!-- Contact Form -->
<form name="form1" method="post" action="send.php">
<table style="text-align:left; padding-left:25px; font-family:Verdana, Geneva, sans-serif; font-size:18px; color:#fff;" width="404" border="0">
<tr>
<td width="130">Name:</td>
<td width="261"><input name="name" type="text" id="name" size="46"></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email" id="email" size="46"></td>
</tr>
<tr>
<td>Subject:</td>
<td><input type="text" name="subject" id="subject" size="46"></td>
</tr>
<tr>
<td>Comments:</td>
<td><textarea name="comments" id="comments" cols="35" rows="5"></textarea></td>
</tr>
<tr>
<td>Security:</td>
<td>6+4 =
<label for="security"></label>
<input type="text" name="security" id="security" size="6"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" id="submit" value="Send"></td>
</tr>
</table>
< /form>
< !-- Contact Form Ends -->
</div>

css for form...

#c4b1 {
width:440px;
height:580px;
box-shadow: 0px 5px 5px 0px #333;
padding: 5px;
background-image:url(../images/box_back2.jpg);
background-repeat:no-repeat;
}

#c4b1 a {
color:#FF6;
}

#c4b1 a:hover{
color:#666;
}

/* Contact Form Settings */

#name {
border-radius:10px 10px;
background-color:#CCC;
}

#email {
border-radius:10px 10px;
background-color:#CCC;
}

#subject {
border-radius:10px 10px;
background-color:#CCC;
}

#comments {
border-radius:10px 10px;
background-color:#CCC;
}

#security {
border-radius:10px 10px;
background-color:#CCC;
}

.success {
color: #0F3;
margin-left: 15px;
font-family: "Century Gothic", Verdana, sans-serif;
}

.fail {
color: #F00;
margin-left: 15px;
font-family: "Century Gothic", Verdana, sans-serif;
}

/* Contact Settings End */

Hope this helps anyone help me!

post-59873-0-17148800-1389366141_thumb.jpg

post-59873-0-89795600-1389366142_thumb.jpg

  • Author

Would that require putting each individual field its in own DIV or something different....i am a complete newbie at this so im learning as i go along...

You dont have to wrap the inputs in divs you can style the inputs width and height by selecting the tags or their ID's. But it would be a good idea to wrap each text label with the coresponding input in a div.

Heres a rather flexible example

 

HTML

<form id="myForm">
    <div class="formRow">
        <label for="name">Name:</label>
        <input type="text" name="name" id="name">
    </div>
    <div class="formRow">
        <label for="email">E-mail:</label>
        <input type="text" name="email" id="email">
    </div>
    <div class="formRow">
        <label for="comments">Comments:</label>
        <textarea name="comments" id="comments"></textarea>
    </div>
</form>

 

CSS

form {
   width: 100%;
   max-width: 300px;
}
.formRow{
       margin:8px 0;
}
label{
       width: 18%;
       min-width: 100px;
}
input, textarea{
       float: right;
       width: 80%;
       max-width: 180px;
}
textarea{
       min-height: 150px;
}

Edited by Nillervision

  • Author

Thanks for the idea..

ive just re-designed it this way...

 

<form name="form1" method="post" action="send.php">
<div class="frmcontainer"><div class="frm1"><label>Name:</label></div>
<div class="frm2"><input name="name" type="text" id="name" size="45"></div>
</div>
<div class="frmcontainer"><div class="frm1"><label>Email:</label></div>
<div class="frm2"><input name="email" type="text" id="email" size="45"></div>
</div>
<div class="frmcontainer"><div class="frm1"><label>Subject:</label></div>
<div class="frm2"><input name="subject" type="text" id="subject" size="45"></div>
</div>
<div id="frmcontainer4"><div id="frm7"><label>Comments:</label></div>
<div id="frm8"><textarea name="comments" cols="35" rows="5" id="comments"></textarea></div>
</div>
<div class="frmcontainer"><div class="frm1"><label>Security:</label></div>
<div class="frm2"><input name="security" type="text" id="security" size="10" value="6 + 4=?"></div>
</div>
<div class="frmcontainer"><div class="frm1"><label> </label> </div>
<div class="frm2"><input name="submit" type="submit" id="submit" value="Submit"></div>
</div>
</form>         

 

.frmcontainer {
	width:420px;
	height:25px;
}

#frmcontainer4 {
	width:420px;
	height:100px;
}

.frm1 {
	width:100px;
	height:25px;
	float:left;
}

.frm2 {
	width:270px;
	height:25px;
	float:right;
}

#frm7 {
	width:100px;
	height:100px;
	float:left;
}

#frm8 {
	width:270px;
	height:100px;
	float:right;
}

here's the link..

http://www.ihost-design.com/bensmith/contact.php

 

now hanging over on all browsers, what styling am i missing to resolve it?


input, textarea { max-width: 100%; }
  • Author

Problem solved, bit of moving around....

used this following code...

 

<!-- Contact Form -->
<form name="form1" method="post" action="send.php">
<div class="frmcontainer"><div class="frm1"><label>Name:</label></div>
<div class="frm2"><input name="name" type="text" id="name" size="35"></div>
</div>
<div class="frmcontainer"><div class="frm1"><label>Email:</label></div>
<div class="frm2"><input name="email" type="text" id="email" size="35"></div>
</div>
<div class="frmcontainer"><div class="frm1"><label>Subject:</label></div>
<div class="frm2"><input name="subject" type="text" id="subject" size="35"></div>
</div>
<div id="frmcontainer4"><div id="frm7"><label>Comments:</label></div>
<div id="frm8"><textarea name="comments" cols="30" rows="5" id="comments"></textarea></div>
</div>
<div class="frmcontainer"><div class="frm1"><label>Security:</label></div>
<div class="frm2"><input name="security" type="text" id="security" size="10" value="6 + 4=?"></div>
</div>
<div class="frmcontainer"><div class="frm1"><label> </label> </div>
<div class="frm2"><input name="submit" type="submit" id="submit" value="Submit"></div>
</div>
</form> 
<!-- Contact Form Ends -->
/* Contact Form Settings End */

.frmcontainer {
	width:420px;
	height:25px;
}

#frmcontainer4 {
	width:420px;
	height:120px;
}

.frm1 {
	width:85px;
	height:25px;
	float:left;
}

.frm2 {
	width:335px;
	height:25px;
	float:right;
}

#frm7 {
	width:85px;
	height:120px;
	float:left;
}

#frm8 {
	width:335px;
	height:120px;
	float:right;
}

#name {
	border-radius:10px 10px;
	background-color:#CCC;
	padding-left:2px;
}

#email {
	border-radius:10px 10px;
	background-color:#CCC;
	padding-left:2px;
}

#subject {
	border-radius:10px 10px;
	background-color:#CCC;
	padding-left:2px;
}

#comments {
	border-radius:10px 10px;
	background-color:#CCC;
	padding-left:2px;
}

#security {
	border-radius:10px 10px;
	background-color:#CCC;
	padding-left:2px;
}

.success {
	color: #0F3;
	margin-left: 15px;
	font-family: "Century Gothic", Verdana, sans-serif;
}

.fail {
	color: #F00;
	margin-left: 15px;
	font-family: "Century Gothic", Verdana, sans-serif;

/* End of Form */

question....

at the end of the CSS where i have #name #email etc for the settings on the background of the text area's etc, can i do a universal rule for these or do i have to type them all seperatley?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.