Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old September 12th, 2009, 03:14 PM
stan801003 stan801003 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 110 stan801003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 20 h 21 m 40 sec
Reputation Power: 3
Javascript - Optional Display Field error

HI,

I have managed to resolve the problem i had earlier, however i now have another problem, well in fact two.

Firstly when i select the correct field from the drop down menu the required additional five fields are displayed. However if i then try and change back to the other value in the drop down menu the aditinal fields do not disappear like they are supposed to and i can't sem to find why.

Secondly this all works locally in my browser, but as soon as i upload it to my website it stops working.

If anybody has any ideas or suggestions then i would be grateful for any direction.

Thanks

Stan

Code:

<!--
function displayoptional(){
var a= document.forms['capform'].elements['camper'].value
if(a ='camper'){
document.getElementById('optional').style.display = '';
}
else if(a ='owner')
{
document.getElementById('optional').style.display = 'none';
}//endif
}//end displayoptional function



Code:
 <form action="register.php" method="post" name="capform"  class="FormGeneric" onSubmit="return capCheck(this);">
    <table width="400" border="0">
      <tr>
        <td width="142">&nbsp;</td>
        <td width="248"><select name="camper" id="camper" onchange='displayoptional()'>
          <option value="camper">Camper</option>
          <option value="owner">Owner</option>
        </select></td>
      </tr>
      <tr>
        <td>Email Address</td>
        <td><span style="width:275px">
          <input type="text" name="email_address" size="30" value="[var.email_address]" />
        </span></td>
      </tr>
      <tr>
        <td>Username</td>
        <td><span style="width:275px">
          <input type="text" name="user_name" size="20" value="[var.user_name]" />
        </span></td>
      </tr>
      <tr>
        <td>Password</td>
        <td><span style="width:275px">
          <input type="password" name="password" size="20" value="[var.password]" />
        </span></td>
      </tr>
      <tr>
        <td>Confirm Password</td>
        <td><input type="password" name="confirm_password" size="20" value="[var.confirm_password]" /></td>
      </tr>
    </table>
     <div style='display:none' id='optional'>
     <table width="400" border="0">
       <tr>
         <td>Mobile Number</td>
         <td><input type="text" name="mobile_number" size="20" value="[var.mobile_number]" />&nbsp;</td>
       </tr>
       <tr>
         <td>Phone Number</td>
         <td><input type="text" name="phone_number" size="20" value="[var.phone_number]" />&nbsp;</td>
       </tr>
       <tr>
         <td>Address&nbsp;</td>
         <td><input type="text" name="address" size="20" value="[var.address]" />&nbsp;</td>
       </tr>
       <tr>
         <td>Postcode&nbsp;</td>
         <td><input type="text" name="postcode" size="20" value="[var.postcode]" />&nbsp;</td>
       </tr>
       <tr>
         <td>Choice&nbsp;</td>
         <td><input type="text" name="camping_choice" size="20" value="[var.camping_choice]" />&nbsp;</td>
       </tr>
     </table>
     </div>
     <table width="400" border="0">
       <tr>
         <td width="143">Select to agree</td>
         <td width="247"><span style="width:275px">
           <input type="radio" value="yes" name="terms" [var.checked] />
&nbsp;&nbsp;&nbsp;&nbsp;<a href="page.php?page=3" target="_blank">Our terms</a></span></td>
       </tr>
       <tr>
         <td><img src="image.php" alt="" name="capimage" border="0" id="capimage" /></td>
         <td><span style="width:150px; text-align:left">
           <input type="text" value="" name="captext" size="17" />
         </span></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td><input type="submit" value="Register" name="registe_r"/>
           <input type="hidden" name="form_submitted" value="yes" />
          &nbsp;</td>
       </tr>
     </table>
  </form>

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Javascript - Optional Display Field error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek