close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Date reformat in coupon, product insert

Thread began 11/21/2010 11:48 pm by Russell Collins | Last modified 3/23/2011 4:52 pm by Russell Collins | 3246 views | 12 replies

jebrandon343719

Strange

Hi Jason, I had already done that. The spry format is yyyy-mm-dd
I modified by using your code above.
I enter 10/03/2011 - the server code (on blur) converts this to 2011-03-10
On submit I get the error below. It occurs even if I leave the 2nd field blank.
This is my code
<label for="S_UserRegistrationDate">Registration Date:</label>
<span id="sprytextfield2">
<span id="sprytextfield2">
<input class="dateRange" name="S_UserRegistrationDate" type="text" id="S_UserRegistrationDate" onblur="if (document.getElementById('S_UserRegistrationDateServerValidation')) document.getElementById('S_UserRegistrationDateServerValidation').style.display='none';WAValidateDT(document.forms[0].S_UserRegistrationDate,'- Invalid date or time',true,/\b([12]\d|3[0-1]|0?[1-9])\/(1[0-2]|0?[1-9])\/\d{4}\b/,'yyyy-mm-dd','','',false,/.*/,'','','',document.forms[0].S_UserRegistrationDate,0,true)" value="<?php echo((isset($_GET["S_UserRegistrationDate"]))?$_GET["S_UserRegistrationDate"]:"") ?>" size="15" />
</span> to <span id="sprytextfield3">
<input class="dateRange" type="text" name="S_UserRegistrationDate2" id="S_UserRegistrationDate2" value="<?php echo((isset($_GET["S_UserRegistrationDate2"]))?$_GET["S_UserRegistrationDate2"]:"") ?>" onblur="if (document.getElementById('S_UserRegistrationDateServerValidation')) document.getElementById('S_UserRegistrationDateServerValidation').style.display='none';WAValidateDT(document.forms[0].S_UserRegistrationDate2,'- Invalid date or time',true,/\b([12]\d|3[0-1]|0?[1-9])\/(1[0-2]|0?[1-9])\/\d{4}\b/,'yyyy-mm-dd','','',false,/.*/,'','','',document.forms[0].S_UserRegistrationDate2,0,true)" size="15" />
<span class="textfieldInvalidFormatMsg">Invalid format.</span></span><span id="additionalErrorZone" class="additionalErrorZone"><span class="textfieldRequiredMsg textfieldInvalidFormatMsg textfieldMinCharsMsg textfieldMaxCharsMsg textfieldMinValueMsg textfieldMaxValueMsg">Please enter a valid date, or leave these fields blank.</span></span>
<?php
if (ValidatedField("usersResults","usersResults")) {
if ((strpos((",".ValidatedField("usersResults","usersResults").","), "," . "2" . ",") !== false || "2" == "") || (strpos((",".ValidatedField("usersResults","usersResults").","), "," . "3" . ",") !== false || "3" == "")) {
if (!(false)) {
?>
<span class="textfieldServerError" id="S_UserRegistrationDateServerValidation">Please enter a valid date, or leave these fields blank.</span>
<?php //WAFV_Conditional users_Results.php usersResults(2,3:)
}
}
}?>

This is the Spry:
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {validateOn:["blur"], isRequired:false});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "date", {format:"yyyy/mm/dd", isRequired:false, additionalError:"additionalErrorZone"});
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "date", {format:"yyyy/mm/dd", isRequired:false, additionalError:"additionalErrorZone"});

Thanks

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...