I've been thrown in at the deep end at work, I grew up knowing plain HTML (mid-90's) and I've been asked to alter a form at work that's in PHP, I can alter PHP code written by others, but there's no way I could write it myself. I've altered this form to just about how I want it, but there's 1 bit I want to alter, if anyone can help it would be greatly appreciated...
been on this for 2 days searching the web and trying stuff, I have the following
<p class="quest">Date from: <input type="text" name="acc2" class="tcal" value="" /> to: <input type="text" name="acc3" class="tcal" value="" />
it uses javascript to pop up a calendar (tigra calendar) that then returns 2 dates (acc2 and acc3), the dates are in d/m/Y (DD/MM/YYYY) format (standard here in Europe/Aus/NZ). What I'm wanting to do is get it to check if the difference is greater than 42 days (6 weeks), if it is I want it to display some text with a link (42 days or less is fine). If I put on the page as a test:
<?php echo($acc3); ?>
then it displays 1341442800 on the page (before a date is chosen), if the user selects a date then the above number stays (not dynamic)
Is what I'm wanting possible? If not, can it be checked on submission and pop up an alert (without the link)? I currently use Javascript to check the form, an example is:
<script language="javascript" type="text/Javascript">
<!--
function collect() {
if(document.all.ct.value == "TempAcc")
{
if(document.all.acc7.value.length <11)
{
alert("You need to fill in your contact number with your FULL number including STD code.");
return false;
}
}
}//end function collect
//-->
</script>
any help with this would be very much appreciated, please try to be specific with any code as I'm am still very much a beginner. Thanks in advance.