Hey all. In Joomla! I have to setup a message form to possess a 48 hour buffer. Quite simply I'm not going customers to have the ability to submit a message form unless of course it's 48 hrs before to start dating ? selected from the drop lower menu.

If a person has already established knowledge about the situation I described and may point me within the correct direction that might be great.


Basically, you do form validation. You have to trigger some javascript once the form is posted, then calculate time distinction between now and also the selected date. Difficult to give exact code without seeing that which you have, however i can provide you with the fundamentals -

Within the form -

<form action="your_submit_url.php" onSubmit="return TestDate()">

The javascript -

function TestDate()
today=new Date()
selectdate = Form.elements["yourdate"].value;

if ((Math.ceil((today.getTime()-selectdate.getTime())/(86400000)) >= 2) {
    return true;
    alert('Some warning about 2 days');
    return false;

Clearly you will have to make changes to fit your form, but this is actually the fundamental idea. Also, I did not test the javascript whatsoever, knowing me it will have to be updated as well.