close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Changing the Date Format in the Update Page

Thread began 10/04/2012 7:36 am by salaroche | Last modified 10/05/2012 9:25 pm by salaroche | 1424 views | 5 replies |

salaroche

Changing the Date Format in the Update Page

Jason:

Following your suggestions some time ago, DW now accepts and displays the date format dd-mm-yyyy in most WADA pages (i.e., insert, delete, details, etc.) but not in the Update page.

The line of code" <?php echo(date("d.m.Y", strtotime($row_WADAoxadmain['regDate']))); ?> allows user to enter dates in the Insert page with the dd-mm-yyyy format, and the line of code <?php echo(str_replace('"', '&quot;', $row_WADAoxadmain['regDate'])); ?> seems to be the one that stores the new dates in the Update page.

Is there any way to combine both lines of code (or any other way) so that users can enter dates in the dd-mm-yyyy format in the Update page?

Thank you for your attention

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the update page please.

Sign in to reply to this post

salaroche

Jason:

Attached please find a copy of the Update page.

Thank you for your attention

Attached Files
SalarocheUpdate.zip
Sign in to reply to this post

Jason ByrnesWebAssist

This code displays the date on the page:

php:
<input type="text" name="regDate" id="regDate" value="<?php echo(str_replace('"''&quot;'$row_WADAoxadmain['regDate'])); ?>" size="12" />



you can use the date() function to change the format of the date that is displayed:

php:
<input type="text" name="regDate" id="regDate" value="<?php echo(str_replace('"''&quot;'date("d.m.Y",strtotime($row_WADAoxadmain['regDate'])))); ?>" size="12" />





at line 1 you have this code to convert the date top Y-m-d format:

php:
<?php 

if($_SERVER["REQUEST_METHOD"] == "POST")     { 
  
$_POST['dateReg'] = "".((isset($_POST["dateReg"]))?date("Y-m-d"strtotime($_POST["dateReg"])):"")  .""

?>



that is incorrect for this form since the form element being used is named "regDate" not "dateReg", you need to edit that code to use the correct form element name:

php:
<?php 

if($_SERVER["REQUEST_METHOD"] == "POST")     { 
  
$_POST['regDate'] = "".((isset($_POST["regDate"]))?date("Y-m-d"strtotime($_POST["regDate"])):"")  .""

?>
Sign in to reply to this post

salaroche

Jason:

As usual, many thanks.

Sign in to reply to this post

salaroche

Jason:

As usual, many thanks.

Sign in to reply to this post

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