close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Birthdate Column

Thread began 7/29/2011 4:54 pm by johna1964 | Last modified 6/24/2012 8:36 pm by johna1964 | 1941 views | 9 replies |

johna1964

Birthdate Column

I have added a birth date column in the user table. I am unable to figure out how to get the database to include the birth date (the registrants actual date of birth) in the database after including it as a requirement in the registration form.

Does anyone know what the correct settings are in phpMyAdmin?

Thanks!!

johna1964

Sign in to reply to this post

Jason ByrnesWebAssist

set the birth date column data type in the database to be date.

the data base will expect the format to be:
yyyy-dd-mm

In the insert record behavior, select the birthdate column, click the lightning bolt next to value and select your birthdate form element, this will add code similar to:
[php]<?php echo((isset($_POST["birthDate"]))?$_POST["birthDate"]:"") ?>

php:
you can convert the entered date to the format the database is expecting by changing that to:

[php<?php echo((isset($_POST["birthDate"]))?date("Y-m-d"strtotime($_POST["birthDate"])):""?>
Sign in to reply to this post

johna1964

Jason,

Thank you for your reply...I'm still a little confused...

You say 'in the insert record behavior select the birthday column'

So this means in the Server Behaviors panel; double click insert record(users); the Web Assist: Insert Single Record dialog box opens; select binding tab; select UserBirthdate column;

<?php echo ((isset($_POST["Registration_group_Birthdate"]))?$_POST["Registration_group_Birthdate"]:""); ?>

is what is already in the value lightening bolt text box....

When I select the value lightening bolt and expand the Session there is no birthdate to select...

So, what to do?

In the code (lines 244-248):

<div class="lineGroup">
<label for="Registration_group_Birthdate" class="sublabel" > Birthdate:<span class="requiredIndicator">&nbsp;*</span></label>
<div class="errorGroup"> <span id="Registration_group_Birthdate_Spry">
<input id="Registration_group_Birthdate" name="Registration_group_Birthdate" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("registration","Registration_group_Birthdate"):"")); ?>" class="formTextfield_Medium" tabindex="3" onblur="WAValidateDT(document.getElementById('Registration_Basic_Default').Registration_group_Birthdate,'',true,/.*/,'mm/dd/yyyy','','',false,/.*/,'','','',document.getElementById('Registration_Basic_Default').Registration_group_Birthdate,0,true);hideServerError('Registration_group_Birthdate_ServerError')" />
<?php

I have the column in the datebase correct, I think...:)

Sincerely,

johna1964

Sign in to reply to this post

Jason ByrnesWebAssist

  So this means in the Server Behaviors panel; double click insert record(users); the Web Assist: Insert Single Record dialog box opens; select binding tab; select UserBirthdate column;

<?php echo ((isset($_POST["Registration_group_Birthdate"]))?$_POST["Registration_group_Birthdate"]:""); ?>

is what is already in the value lightening bolt text box....  




so change that code to:

php:
<?php echo((isset($_POST["Registration_group_Birthdate"]))?date("Y-m-d"strtotime($_POST["Registration_group_Birthdate"])):""?>
Sign in to reply to this post

johna1964

Jason,

Okay, I changed it to:

<?php echo((isset($_POST["Registration_group_Birthdate"]))?date("Y-m-d", strtotime($_POST["Registration_group_Birthdate"])):"") ?>

It's not passing validation...

Should the spry validation format box be set to a certain format?

And is the "Y-m-d" correct? I'm asking because it just looks like it should be something else...

Thanks!!

johna

Sign in to reply to this post

Jason ByrnesWebAssist

the client validation on the birthdate element is conflicting.


change:

<input id="Registration_group_Birthdate" name="Registration_group_Birthdate" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("registration","Registration_group_Birthdate"):"")); ?>" class="formTextfield_Medium" tabindex="3" onblur="WAValidateDT(document.getElementById('Registration_Basic_Default').Registration_group_Birthdate,'',true,/.*/,'mm/dd/yyyy','','',false,/.*/,'','','',document.getElementById('Registration_Basic_Default').Registration_group_Birthdate,0,true);hideServerError('Registration_group_Birthdate_ServerError')" />



to:

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




yes, the format "Y-m-d" is correct, that is the php date() functions format string for yyyy-mm-dd which is the format the database will be expecting.

Sign in to reply to this post

johna1964

Jason,

It works perfectly!!

The spry validation does not need to match the db format for the birthdate - and still inserts the birthdate info with the db format...awesome!

Thanks for all your help!!

Johna

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

johna1964

See next reply

Sign in to reply to this post

johna1964

Solution

This works:
Click on Insert Record (users) in the Server Behaviors Panel
<?php echo((isset($_POST["Registration_group_Birthdate"]))?date("Y-m-d", strtotime($_POST["Registration_group_Birthdate"])):"") ?>

New:
<input id="Registration_group_Birthdate" name="Registration_group_Birthdate" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("registration","Registration_group_Birthdate"):"")); ?>" class="formTextfield_Medium" tabindex="3" onblur="hideServerError('Registration_group_Birthdate_ServerError')" />

Sign in to reply to this post
loading

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