Good evening/morning
I have 2 fields - start date (pickupdate) and end date(dropoffdate) with a datepicker on both.
When the user picks a start date I would like to change the end date automatically to start date+3 days.
I added an onchange to my input field with a call of a javascript function

Code:
<input type="text" name="pickupdate" id="pickupdate" value="<?php echo htmlspecialchars($demain);?>"  maxlength="10" size="10" onchange="setExpDate()">
I tried adding the 3 days in a function and nothing happened so I just created a text field and asked the function to write "test" in the text box when the pickup date is changed but even that doesn't work:

Code:
<script language="JavaScript1.2">
function setExpDate()
  {  
    objForm.test.value = "test";
  };
</script>
I am obviously doing something glaringly wrong . Please could someone give me an indication of where I am going wrong?
the website is www.carhirecappadocia.com and my complete script is below. Thank you in advance to anybody who could give me some advice.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" >
<head>

<script src="../_frame/ui/jquery.ui.datepicker.min.js"></script>
<script src="../_frame/ui/locales/jquery.ui.datepicker-en-GB.js"></script>
<script src="../_frame/validate.js"></script>

</head>

<body>

<!-- recuperer la date de demain par default pour le pick up -->
<!-- rajouter 3 jours par default pour le dropoff -->
<?php
$demain = date("d/m/Y", mktime(0, 0, 0, date("m"), date("d")+1, date("Y")));
$apres = date("d/m/Y", mktime(0, 0, 0, date("m"), date("d")+4, date("Y")));
?>

<!-- Mettre la couleur de fond de page et d�finir la mise en page -->
<style type="text/css"> 

#back 
{
  font: Arial, Helvetica, sans-serif; color: #FFFFFF;
  display: block;
  float: left;
  width: 280px;
  padding-bottom:5px;
  background: url(background_main.gif) top repeat-x #333333;
}
  
.searchbutton
{
  text-align:center; color:#000000;  
  font-family:Arial, Helvetica, sans-serif; 
  font-size:14px;    
  font-weight:bold;
}


.label
{
  text-align:left; color:#FFFFFF;  
  font-family:Arial, Helvetica, sans-serif; 
  font-size:14px;  
  position: relative;  
  margin-left: 20px;
}

</style>

<script language="JavaScript1.2">
  function validateForm_bv000002( objForm )
  {
    if( objForm.pickupdate.value.length == 0 )
    {
      alert( "Field \"Pick Up Date\" is required !" );
      objForm.pickupdate.focus();
      return false;
    }
    if( objForm.pickupdate.value.length > 10 )
    {
      alert( "Field \"Pick Up Date\" is too long. 10 characters are allowed !" );
      objForm.pickupdate.focus();
      return false;
    }
    var df0 = validDate( objForm.pickupdate.value, "en-GB" );
    if( df0 != "" )
    {
      var s = "Field \"Pick Up Date\" must be a valid MM/DD/YYYY date !";
      df0 = df0.replace( "YY", "YYYY");
      s = s.replace( "DD/MM/YYYY", df0 ).replace( "MM/DD/YYYY", df0 );
      alert( s );
      objForm.pickupdate.focus();
      return false;
    }
     
    if( objForm.dropoffdate.value.length == 0 )
    {
      alert( "Field \"Drop Off Date\" is required !" );
      objForm.dropoffdate.focus();
      return false;
    }
    if( objForm.pickupdate.value.length > 10 )
    {
      alert( "Field \"Drop Off Date\" is too long. 10 characters are allowed !" );
      objForm.dropoffdate.focus();
      return false;
    }
    var df0 = validDate( objForm.dropoffdate.value, "en-GB" );
    if( df0 != "" )
    {
      var s = "Field \"Drop Off Date\" must be a valid MM/DD/YYYY date !";
      df0 = df0.replace( "YY", "YYYY");
      s = s.replace( "DD/MM/YYYY", df0 ).replace( "MM/DD/YYYY", df0 );
      alert( s );
      objForm.dropoffdate.focus();
      return false;
    }    
    objForm.pickupdate.value = convertDateToUserFormat( objForm.pickupdate.value, "en-GB", "dd/mm/yyyy" );
    objForm.dropoffdate.value = convertDateToUserFormat( objForm.dropoffdate.value, "en-GB", "dd/mm/yyyy" );    
    return true;
  }
$(function(){
$("#pickupdate").datepicker({changeMonth:true,changeYear:true,showAnim:"slideDown"});
$("#dropoffdate").datepicker({changeMonth:true,changeYear:true,showAnim:"slideDown"});
});
</script>

<script language="JavaScript1.2">
function setExpDate()
  {  
    objForm.test.value = "test";
  };
</script>

<div id="back">
  <FORM NAME ="bv000002" METHOD ="POST" onsubmit="return validateForm_bv000002( this );" ACTION = "../ourfleet/index.php">
  
  <input type="hidden" name="copyright" value="Copyright � 2012 A E Teknoloji. All rights reserved. Unless otherwise indicated, all materials on these pages are copyrighted by AE Teknoloji. All rights reserved. No part of these pages, either text or image may be used for any purpose other than personal use. Therefore, reproduction, modification, storage in a retrieval system or retransmission, in any form or by any means, electronic, mechanical or otherwise, for reasons other than personal use, is strictly prohibited without prior written permission.  General inquiries should be directed to our Web feedback box, accessible from the link in the footer at the bottom of all pages on this site.">
    
  <div class="label">  
    Pick Up From: <font color="red"><sup style="cursor:help" title="Select a Pick Up Town!">*</sup></font><br /> 
    <select id="pickupfrom" name='pickupfrom'>    
    <option value="Urgup" selected>Urgup, Cappadocia</option>    
    <option value="Goreme">Goreme, Cappadocia</option>    
    <option value="Avanos">Avanos, Cappadocia</option>    
    <option value="Uchisar">Uchisar, Cappadocia</option>        
    <option value="Mustafapasa">Mustafapasa, Cappadocia</option>
    <option value="Kayseri">Kayseri Airport(ASR)</option>    
    <option value="Nevsehir">Nevsehir Airport(NAV)</option>    
    <option value="Istanbul">Istanbul</option>    
    <option value="Ankara">Ankara</option> 
    <option value="Other">Other</option>   
    </select> 
    <br /> 
  
    Drop Off: <font color="red"><sup style="cursor:help" title="Select a Drop Off Town !">*</sup></font><br /> 
    <select id="dropoff" name='dropoff'>    
    <option value="Same" selected>Same As Pick Up</option>
    <option value="Urgup">Urgup, Cappadocia</option>    
    <option value="Goreme">Goreme, Cappadocia</option>    
    <option value="Avanos">Avanos, Cappadocia</option>    
    <option value="Uchisar">Uchisar, Cappadocia</option>        
    <option value="Mustafapasa">Mustafapasa, Cappadocia</option>
    <option value="Kayseri">Kayseri Airport(ASR)</option>    
    <option value="Nevsehir">Nevsehir Airport(NAV)</option>    
    <option value="Istanbul">Istanbul</option>    
    <option value="Ankara">Ankara</option>        
    <option value="Other">Other</option>
    </select>     
    <br />    

    Pick Up Date: <font color="red"><sup style="cursor:help" title="Select a date !">*</sup></font><br /> 
    <input type="text" name="pickupdate" id="pickupdate" value="<?php echo htmlspecialchars($demain);?>"  maxlength="10" size="10" onchange="setExpDate()">    
    <input type="text" name="test" id="test" value="">
    <br />
        
    Drop Off Date: <font color="red"><sup style="cursor:help" title="Select a date !">*</sup></font><br /> 
    <input type="text" name="dropoffdate" id="dropoffdate" value="<?php echo htmlspecialchars($apres);?>" maxlength="10" size="10">  
    <br /> 
    
  </div>  

  <div class="searchbutton">
    <input type="Submit" Name="Submit1" value="Search">  
  </div>
  
</FORM>
</div>
</body>
</html>