473,508 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extra White Space on the HTML form

30 New Member
I need some help with extra spaces in HTML form. There is a big white space appearing at the center of the HTML form that I am designing even though there is no <br> tags been used:



The html code is below:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta
  5.     http-equiv="Content-Type"
  6.     content="text/html; charset=ISO-8859-1"
  7. >
  8. <link
  9.     rel="StyleSheet"
  10.     href="CSS/Lite.css"
  11.     type="text/css"
  12. >
  13. <title>Dyadem Support Portal Registration</title>
  14. <SCRIPT LANGUAGE="JavaScript">
  15. function submitForm(){
  16.  
  17.         //Test the entered values
  18.     if (document.registerForm.fname.value==""){
  19.  
  20.     alert("Please enter your First Name.")
  21.     document.registerForm.fname.focus()
  22.     return false
  23.     }
  24.  
  25.     if (document.registerForm.lname.value==""){
  26.     alert("Please enter your Last name.")
  27.     document.registerForm.lname.focus()
  28.     return false
  29.     }
  30.  
  31.     if (document.registerForm.cname.value==""){    
  32.     alert("Please enter the Company name.")
  33.     document.registerForm.cname.focus()
  34.     return false
  35.     }
  36.  
  37.     if (document.registerForm.phone.value==""){    
  38.     alert("Please enter your Phone #.")
  39.     document.registerForm.phone.focus()
  40.     return false
  41.     }
  42.  
  43.     if (document.registerForm.email.value==""){    
  44.     alert("Please enter the email address.")
  45.     document.registerForm.email.focus()
  46.     return false
  47.     }
  48.  
  49.  
  50.     if (document.registerForm.product.value=="ST"){
  51.     document.registerForm.serial.value="Stature"
  52.     }
  53.  
  54.     if (document.registerForm.serial.value==""){
  55.     alert("Please enter the Serial # of the product purchased. If you don't know one, enter N/A.")
  56.     document.registerForm.serial.focus()
  57.     return false
  58.     }
  59.  
  60.     if (document.registerForm.product.value=="Blank"){
  61.     alert("Product purchased can't be blank.")
  62.     document.registerForm.product.focus()
  63.     return false
  64.     }
  65.     return true
  66.  
  67.     }
  68. function isValidEmail() {
  69.     var email = document.registerForm.email.value
  70.     var AtPos = email.indexOf("@")
  71.     var StopPos = email.lastIndexOf(".")
  72.     Message = ""
  73.  
  74.  
  75.     if (AtPos == -1 || StopPos == -1) {
  76.     alert("Not a valid email address")
  77.     return false
  78.     }
  79.  
  80.     if (StopPos < AtPos) {
  81.     alert("Not a valid email address")
  82.     return false
  83.     }
  84.  
  85.     if (StopPos - AtPos == 1) {
  86.     alert("Not a valid email address")
  87.     return false
  88.     } 
  89.  
  90.     return true
  91. }
  92. //function that performs all functions, defined in the onsubmit event handler
  93. function check(form){
  94. if (submitForm()){
  95.         if (isValidEmail()){
  96.         return true
  97.         }
  98.     }
  99.     return false;
  100. }
  101.  
  102. function toFormat(isField){
  103.  
  104. isPhone = isField.value
  105. if (isPhone.length == 12)
  106.     {isPhone = isPhone.replace(/\D/g,'').replace(/^(\d{3})(\d{3})/,'($1) $2-');isField.value = isPhone;}
  107. else if (isPhone.length > 12 && isPhone.length <= 16)
  108.     {isPhone = isPhone.replace(/\D/g,' ').replace(/^(\d{3})( )(\d{3})/,'($1) $3-').replace(/- /,'-').replace(/( )(\d{1,3}$)/,' x $2');isField.value = isPhone;}
  109. else if (isPhone.length < 10 || isPhone.length > 16 || isNaN(isPhone))
  110.     {
  111.     alert('Invalid phone number')
  112.     isField.value = ""
  113.     isField.style.background = 'Yellow';
  114.     isField.focus()
  115.     }
  116. }
  117. </script>
  118. </head>
  119. <body
  120.     bgcolor="WHITE"
  121.     text="#FFFFCC"
  122.     leftmargin="0"
  123.     topmargin="0"
  124.     marginwidth="0"
  125.     marginheigth="0"
  126. >
  127. <div
  128.     class="top_stripe"
  129.     style="FONT-SIZE: xx-large; BACKGROUND-COLOR: #c0c0c0;"
  130. >&nbsp;</div>
  131. <br>
  132. <br>
  133. <br>
  134. <br>
  135. <center><img
  136.     align="center"
  137.     src="Images/Dyadem.gif"
  138. /> <br />
  139. <br />
  140. <br />
  141. <center><b
  142.     style="FONT-FAMILY: 'Arial'; COLOR: #0080c0; FONT-SIZE: large;"
  143. >DYADEM SUPPORT PORTAL</b></center>
  144. <br>
  145. <br>
  146.  
  147. <img
  148.     src="Images/SupportSitePic.bmp"
  149.     align="center"
  150.     style="width: 247px; height: 192px;margin:0; padding:0"
  151. /> <br>
  152. <br>
  153. <center><u><b>New User
  154. Registration</b></u></center>
  155.  
  156. <form // This is the spot where extra space is showing up
  157.     name="registerForm"
  158.     onSubmit="return check(this.form)"
  159.     Method="POST"
  160.     Action="registrationComplete.jsp"
  161.     align="center"
  162. >
  163. <table
  164.     bgcolor="#EAEAEA"
  165.     width="80%"
  166.     style="margin:0; padding:0"
  167. >
  168.     <center>
  169.     <tr>
  170.         <td><Strong>*First Name:</Strong> <input
  171.             type="text"
  172.             name="fname"
  173.         ></td>
  174.     </tr>
  175.     </center>
  176.  
  177.     </br>
  178.     </br>
  179.  
  180.     <center>
  181.     <tr>
  182.         <td><Strong>*Last Name:</Strong>&nbsp; <input
  183.             type="text"
  184.             name="lname"
  185.         ></td>
  186.     </tr>
  187.     </center>
  188.     </br>
  189.     </br>
  190.     <center>
  191.     <tr>
  192.         <td><Strong>*Company:</Strong>&nbsp;&nbsp;&nbsp; <input
  193.             type="text"
  194.             name="cname"
  195.         ></td>
  196.     </tr>
  197.     </center>
  198.     </br>
  199.     </br>
  200.     <center>
  201.     <tr>
  202.         <td><Strong>*Phone #:</Strong> &nbsp;&nbsp;&nbsp; <input
  203.             type="text"
  204.             name="phone"
  205.             onblur="toFormat(this)"
  206.         ></td>
  207.     </tr>
  208.     </center>
  209.     </br>
  210.     </br>
  211.     <center>
  212.     <tr>
  213.         <td><Strong>*Email:</Strong>
  214.         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input
  215.             type="text"
  216.             name="email"
  217.         ></td>
  218.     </tr>
  219.     </center>
  220.     </br>
  221.     </br>
  222.     <center>
  223.     <tr>
  224.         <td><Strong>*Product:</Strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select
  225.             style="width: 145px; length: 145px;"
  226.             name="product"
  227.         >
  228.             <option value="Blank"></option>
  229.  
  230.     </tr>
  231.     </center>
  232.     </br>
  233.     </br>
  234.     <center>
  235.     <tr>
  236.         <td>&nbsp;<Strong>Serial #:</Strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  237.         <input
  238.             type="text"
  239.             name="serial"
  240.         ></td>
  241.     </tr>
  242.     </center>
  243.     </br>
  244.     </br>
  245.     <tr>
  246.         <td><MARQUEE
  247.             direction="up"
  248.             scrolldelay="800"
  249.             height="20px"
  250.             onmouseover="this.stop()"
  251.             onmouseout="this.start()"
  252.             width="100%"
  253.         >
  254.         <center><b style="FONT-FAMILY: 'Arial';"> <pre><I
  255.             style="FONT-SIZE: medium; COLOR: #ff0000; FONT-FAMILY: 'Arial';"
  256.         >Please fill out all of the required fields in order to register on Dyadem Support Portal.</pre></I></b>
  257.         <br />
  258.         <b
  259.             style="FONT-FAMILY: 'Arial';"
  260.             <pre><I style="FONT-SIZE: medium; COLOR: #ff0000; FONT-FAMILY: 'Arial';">An Active Support and Maintenance agreement is required to complete the registration.</pre>
  261.         </I></b></center>
  262.         </MARQUEE></td>
  263.     </tr>
  264.     </br>
  265.     </br>
  266.     <tr>
  267.         <td>
  268.         <center><input
  269.             type="reset"
  270.             value="Clear"
  271.         /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input
  272.             type="submit"
  273.             value="Submit"
  274.             name="submit"
  275.         /> &nbsp;&nbsp;&nbsp;&nbsp; <input
  276.             type="button"
  277.             value="Cancel"
  278.             onClick="parent.location='https://support.dyadem.com'"
  279.         /></center>
  280.         </td>
  281.     </tr>
  282. </table>
  283. </form>
  284. </center>
  285. </br>
  286. </br>
  287. <div
  288.     class="top_stripe"
  289.     style="FONT-SIZE: xx-large; BACKGROUND-COLOR: #c0c0c0;"
  290. >&nbsp;</div>
  291. </body>
  292. </html>
Nov 13 '08 #1
2 4693
eWish
971 Recognized Expert Contributor
Try validating your markup and fixing the errors first.


Also, please use the code tag when you are posting markup or code. Thanks.

--Kevin
Nov 13 '08 #2
David Laakso
397 Recognized Expert Contributor
With 9 yards of garbage code containing 57 markup validation errors and proprietary HTML consider yourself fortunate it shows up on the screen at all...
Nov 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
4117
by: Brian | last post by:
Hello group, http://people.umass.edu/btrembla/ (html 4.01/strict) uses a conventional menu marked up as a list, and css http://people.umass.edu/btrembla/css/brian.css...
2
3384
by: Jerry Sievers | last post by:
tried to avoid using PRE in the page markup and instead used DIV CLASS=foo and assigned the white-space pre property to it. have some reports already that text is not showing as preformatted. ...
0
15175
by: Mark Moore | last post by:
I'm trying to layout a couple text input fields and their corresponding labels without using a table. When I was trying to debug my understanding of CSS, I was *very* surprised to see that span's...
38
23942
by: Xah Lee | last post by:
sometimes i wish to add white space in <p> as to achived effects similar to tab. what should i do? using empty image seems the sure way but rather complicated. (and dosen't change size with...
3
3354
by: Prince | last post by:
I have some <RequiredFieldValidator> on my page and everything works fine except that there are lots of white spaces between the web server controls that are being validated. I've set the Display...
2
2372
by: Mike | last post by:
All: I am a newbee to ASP.NET I have created an aspx webpage for the title bar which I want to use in other pages in the website.When I use an iframe in webpages to use the title bar, I get an...
2
1528
by: Victor | last post by:
Hi I have a very strange problem for my page. I have writen a js to make sure my table's height is 100% for the browser's viewport. my code is just the following. This works fine for firefox and...
1
4318
by: bdbeames | last post by:
I am currently getting some forecast data from a web site using (file_get_contents), then I'm using explode to put the string in an array, which I am then parsing. The trouble is when I use...
3
2480
by: Lawrence Krubner | last post by:
This is one of the more bizarre things I've seen in a while. We've a function called getListOfAllDatabaseTables that does about what you'd expect. It lives in a file called...
0
7118
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.