Newbir please please help with form

This is a discussion on "Newbir please please help with form" within the JavaScript Forum section. This forum, and the thread "Newbir please please help with form are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 28th, 2007, 23:20
New Member
Join Date: Nov 2007
Location: UK
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Newbir please please help with form

Hi

I paid someone to create a form for me and it was a total mess and they are refusing to sort it. I have aligned it the best I can but it isn't perfect, when you click on number in party and select 10-12 the last the 3 imput boxes are misaligned.
Also the Party leader field is as misaligned.

Please can someone help me, I need to get this sorted asap.

Here is the form link http://www.lm-lakeland-design.co.uk/Villa/Form.html

This is the code in the header
HTML: Select all
<script type="text/javascript">
                                         var listNames = ["arrival_day","departure_day","birth_day[]","arrival_month","departure_month","birth_month[]","number_in_party"];
                                         var listOpts = ["31","31","31","12","12","12","12"];  // the last integer is the maximum number of guests;
                                         var prevGuests = 1;
                                         var lastGuest =1; 
                                         function updateGuests(nGuests){
                                          if (nGuests == 0)
                                           {
                                            return; 
                                           } 
                                          var desiredGuests = nGuests-prevGuests; 
                                          if (desiredGuests > 0)
                                           {
                                            for (i=0; i<desiredGuests; i++)
                                            {
                                             var nFields = document.forms[0].getElementsByTagName('fieldset')[0];
                                             var nClone = document.forms[0].getElementsByTagName('div')[1].cloneNode(true);     
                                             var nFloor = document.getElementById('submit');  
                                               nFields.insertBefore(nClone,nFloor);
                                             if (lastGuest < 9)
                                             {
                                               nClone.firstChild.nodeValue = nClone.firstChild.nodeValue.replace(/\d{1,}/,Number(lastGuest + 1));
                                              var nGuest = document.getElementsByName('guest_name[]');
                                              nGuest[nGuest.length-1].value = "";     
                                             } 
                                             else  {
                                              nClone.firstChild.data = nClone.firstChild.data.substring(0,10).replace(/\d{1,}/,Number(lastGuest + 1));
                                              var nGuest = document.getElementsByName('guest_name[]');
                                              nGuest[nGuest.length-1].value = "";          
                                             }
                                             lastGuest = Number(nClone.firstChild.data.match(/\d{1,}/)[0]); 
                                            }
                                           }
                                          else  {
                                            desiredGuests = Math.abs(desiredGuests);
                                            for (i=0; i<desiredGuests; i++)
                                            {
                                             var nFields = document.forms[0].getElementsByTagName('fieldset')[0];
                                             nFields.removeChild(nFields.lastChild.previousSibling.previousSibling);
                                             lastGuest--;
                                            }
                                           }
                                          prevGuests = nGuests;
                                          document.body.focus();
                                         }
                                         function fillSelect(nList){
                                          for (n=0; n<listOpts[i]; n++)
                                           {
                                            var nOption = document.createElement('option'); 
                                            if (n < 9 && nList != "number_in_party")
                                            {
                                             var nData = document.createTextNode("0"+(n+1)); 
                                             nOption.setAttribute("value","0"+(n+1)); 
                                            }
                                             else  {
                                              var nData = document.createTextNode(n+1); 
                                             nOption.setAttribute("value",n+1); 
                                            }     
                                             nOption.appendChild(nData); 
                                            document.forms[0][nList].appendChild(nOption); 
                                           }
                                         }
                                         
                                         function init(){
                                          
                                          for (i=0; i<listNames.length; i++)
                                           {
                                            fillSelect(listNames[i])
                                           }
                                          for (i=2007; i>1906; i--)
                                           {
                                            var nOption = document.createElement('option'); 
                                             var nData = document.createTextNode(i); 
                                             nOption.setAttribute('value',i); 
                                             nOption.appendChild(nData); 
                                            document.forms[0]['birth_year[]'].appendChild(nOption); 
                                           }   
                                         }
                                         onload=init; 
                                         
                                        </script>
<style type="text/css"> 
form {width: 420px; font-family: Arial; font-size: 12pt;} 
fieldset {width: 420px; background-color: #F6EABC; border: 1px solid #E6B280; padding-left: 8px; padding-bottom: 8px;} 
legend {font-family: Arial; font-size: 14pt; color: #000000; background-color: transparent; padding-left: 8px; padding-right: 8px; padding-top: 3px; margin-bottom: 5px;} 
select {font-family: Arial; font-size: 10pt; margin-top: 3px; margin-bottom: 3px; margin-right: 3px; width: 53px; vertical-align:middle} 
.input_field {font-family: Arial; font-size: 10pt; padding-left: 2px; padding-top: 1px; padding-bottom: 1px; margin-top: 3px; margin-bottom: 3px;} 
.input_textarea {font-family: Arial; font-size: 10pt; width: 218px; height: 65px; padding: 2px; margin-top: 3px; margin-bottom: 3px; overflow: hidden;} 
.submitBtn {font-family: Arial; font-size: 10pt; font-weight: bold; cursor: pointer; padding-top: 2px; padding-bottom: 2px; margin: 15px 0 5px; background-color: #ffffff; border: solid 1px #000000;} 
.label_1 {position: relative; top: -0px;margin-right: 23px; } 
.label_2 {position: relative; top: -40px; margin-right: 109px;} 
.label_3 {position: relative; top: +3px;margin-right:93px;} 
.label_4 {position: relative; top: +3px;margin-right: 49px;} 
.label_5 {position: relative; top: +3px;margin-right: 121px;} 
.label_6 {position: relative; top: +3px;margin-right: 128px;} 
.label_7 {position: relative; top: +5px;margin-right: 86px;} 
.label_8 {position: relative; top: +5px;margin-right: 60px;} 
.label_9 {position: relative; top: +6px;margin-right: 56px;} 
.label_10 {position: relative; top: +3px;margin-left: 25px; margin-top: 9px;} 
.label_11 {margin-right: 5px; margin-top: 5px;} 
label {vertical-align: 25%} 
#submit {margin-left:180px;} 
</style>
 
 
Anh the form HTML
 
<form method="post" action="mailto:">
                                                                                     <fieldset>
                                                                                   <legend>Reservation/Enquiry Form</legend>
                                                                                    <label class="label_1">Party / Group Leader:</label>
                                                                                    <input type="text" name="group_leader" size="30" class="input_field">
                                                                                    <br>
                                                                                    <label class="label_2">Address:</label>
                                                                                    <textarea name="postal_address" class="input_textarea"></textarea>
                                                                                    <br>
                                                                                    <label class="label_3">Post Code:</label>
                                                                                    <input type="text" name="postal_code" size="30" class="input_field">
                                                                                    <br>
                                                                                    <label class="label_4">Home Telephone:</label>
                                                                                    <input type="text" name="home_phone" size="30" class="input_field">
                                                                                    <br>
                                                                                    <label class="label_5">Mobile:</label>
                                                                                    <input type="text" name="mobile_phone" size="30" class="input_field">
                                                                                    <br>
                                                                                    <label class="label_6">Email:</label>
                                                                                    <input type="text" name="email_address" size="30" class="input_field">
                                                                                 
                                                                                    <br>
                                                                                    <label class="label_7">Arrival Date:</label>
                                                                                    <select name="arrival_day">
                                                                                     <option value="">dd</option>
                                                                                    </select>
                                                                                    <select name="arrival_month">
                                                                                     <option value="">mm</option>
                                                                                    </select>
                                                                                    <select name="arrival_year">
                                                                                     <option value="">yyyy</option>
                                                                                     <option value="2007">2007</option>
                                                                                     <option value="2008">2008</option>
                                                                                     <option value="2009">2009</option>
                                                                                     <option value="2010">2010</option>     
                                                                                    </select>
                                                                                    <br>
                                                                                    <label class="label_8">Departure Date:</label>
                                                                                    <select name="departure_day">
                                                                                     <option value="">dd</option>
                                                                                    </select>
                                                                                    <select name="departure_month">
                                                                                     <option value="">mm</option>
                                                                                    </select>
                                                                                    <select name="departure_year">
                                                                                     <option value="">yyyy</option>
                                                                                     <option value="2007">2007</option>
                                                                                     <option value="2008">2008</option>
                                                                                     <option value="2009">2009</option>
                                                                                     <option value="2010">2010</option> 
                                                                                    </select>
                                                                                    
                                                                                    <br>
                                                                                    <label class="label_9">Number in Party:</label>
                                                                                    <select name="number_in_party" onchange="updateGuests(this.value)">
                                                                                     <option value="0">?</option>
                                                                                    </select>
                                                                                    <div class="label_10">Guest Details - Name &amp; Date of Birth:</div>  
                                                                                    
                                                                                    <div class="label_11" id="guest_info">Guest1:
                                                                                     <input type="text" name="guest_name[]" size="19" class="input_field" style="vertical-align:middle">
                                                                                     <select name="birth_day[]">
                                                                                      <option value="">dd</option>
                                                                                     </select>
                                                                                     <select name="birth_month[]">
                                                                                      <option value="">mm</option>
                                                                                     </select>
                                                                                     <select name="birth_year[]">
                                                                                      <option value="">yyyy</option>
                                                                                     </select>
                                                                                    </div>
                                                                                    <input type="submit"  name="submit" id="submit" value="Submit" class="submitBtn">
                                                                                     </fieldset>
                                                                                  </form> 
                  </DIV>
              </div>
            </td>
          </tr>
        </table>
  </BODY>
</HTML>
Thanks Loads to anyone who can help me

Marie

Last edited by Rakuli; Nov 29th, 2007 at 12:10. Reason: added BBC tags
Reply With Quote

  #2 (permalink)  
Old Nov 29th, 2007, 12:11
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Newbir please please help with form

Umm, that form seems perfectly aligned to me, have you fixed it since posting?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding / Showing form fields based on previous form input John Alexander Hopper PHP Forum 1 Mar 10th, 2008 11:30
form variable within an iframe component of a form kissfreaque PHP Forum 3 Feb 29th, 2008 13:06
form variable within an iframe component of a form kissfreaque JavaScript Forum 5 Feb 29th, 2008 11:57
[SOLVED] PHP contact form redirect to same form Posie PHP Forum 14 Jan 29th, 2008 20:28
ASP form to check weather a form value is already in the database Andrew1986 Classic ASP 3 Oct 25th, 2007 08:23


All times are GMT. The time now is 19:34.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43