close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Datepicker and dates

Thread began 12/21/2012 6:16 am by thehalpeen319342 | Last modified 12/21/2012 11:53 am by thehalpeen319342 | 2655 views | 7 replies

thehalpeen319342

Jason below is 3 bits of code on the insert page and after that is the code on the page that displays the date (update page).

INSERT PAGE

// manual insertion re posting date in European format
if(isset($_POST['DOB'])) {
$_POST['DOB'] = date("Y-m-d", strtotime(str_replace("/","-",$_POST['DOB'] )));
}
?>



<script type="text/javascript">
$(function(){
$('#DOB').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'dd/mm/yy',
yearRange: "1900:2012",
maxDate: 0,
minDate: new Date(1900, 1 - 1,1),
showAnim: 'show',
onClose: closeDatePicker_DOB
});
});
function closeDatePicker_DOB() {
var tElm = $('#DOB');
if (typeof DOB_Spry != null && typeof DOB_Spry != "undefined" && DOB_Spry.validate) {
DOB_Spry.validate();
}
var docElm = document.getElementById("DOB");
var tBlur = docElm.getAttribute("onBlur");
if (!tBlur) tBlur = docElm.getAttribute("onblur");
if (!tBlur) tBlur = docElm.getAttribute("ONBLUR");
if (tBlur) {
tBlur = String(tBlur).replace(/\bthis\b/g, "docElm");
eval(tBlur);
}
}
</script>


<input id="DOB" name="DOB" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("addmember","DOB"):"")); ?>" class="formTextfield_Medium" tabindex="6" onblur="hideServerError('DOB_ServerError');"/>

_________________________________________________________________________

UPDATE/DETAILS Page - which displays the date

<div class="fieldGroup"> <span id="DOB_Spry"> <span>
<input id="DOB" name="DOB" type="text" value="<?php echo(date("d/m/Y", strtotime($row_rsMembers_Update['memberDOB']))); ?>" class="formTextfield_Medium" tabindex="6" onblur="hideServerError('DOB_ServerError');"/>
<span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldRequiredMsg">Please enter or select a date</span> </span> </span>
<?php
if (ValidatedField('updatemember','updatemember')) {
if ((strpos((",".ValidatedField("updatemember","updatemember").","), "," . "5" . ",") !== false || "5" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="DOB_ServerError">Please enter or select a date</span>
<?php //WAFV_Conditional update_member.php updatemember(5:)
}
}
}?>
</div>
</div>
</div>
</div>
</div>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...