Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2006, 06:38 AM
Authorized User
 
Join Date: Jun 2003
Location: Dublin, , Ireland.
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

first by using "call es_date_time_type(i1, 7)" you are looking for a
sub es_date_time_type
....
end sub.

What I gave you above is a function that needs to be used before the update code.

i1 = trim(request.form("date_time_field")
i1 = es_date_time_type(i1, 7)

then your sql update

 
Old January 25th, 2006, 09:37 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

i changed my codes to these:
<script for="textfield" language="VBScript" event="Onkeypress">
            Dim i1
            i1=Document.form1.textfield.value
            i1=es_date_time_type(i1,7)
            Document.form1.textfield.value=i1
            </script>
but it is still give me such error


 
Old January 25th, 2006, 09:41 AM
Authorized User
 
Join Date: Jun 2003
Location: Dublin, , Ireland.
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

why do you use JavaScript to achieve this?

can you not do the changes before update call?

 
Old January 25th, 2006, 10:20 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

Quote:
quote:Originally posted by lucian
 why do you use JavaScript to achieve this?

can you not do the changes before update call?

the values that change before update are old values and when user change those valuse the valuse that the users changed should be insert to database.so i think i should do changes at the time that the update call.ofcourse I don't know is it a correct way or no.I like to uniderstand if there is a good way for do that.
thank you again because of your useful help(user can now update their new values if they enter yyyy/mm/dd format but if they want just to update one of dates they should change others too.because the old dates that tey entered them before are shown as:dd/mm/yyyy and sql doesn't accept these.

 
Old January 25th, 2006, 10:30 AM
Authorized User
 
Join Date: Jun 2003
Location: Dublin, , Ireland.
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

when they want to update, you should convert the old values as well using the above function.
All this should happen before the sql update statement, or you could use the function to display the old values the way you want to be inserted into the database.

<input type="text" value="<%=es_date_time_type(your_rs_value,7)%>" name="your_name" />

 
Old January 25th, 2006, 11:11 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

Thank you very very very much:)it is working now and i learned many useful things from you.

 
Old January 25th, 2006, 11:58 AM
Authorized User
 
Join Date: Jun 2003
Location: Dublin, , Ireland.
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

glad i could help





Similar Threads
Thread Thread Starter Forum Replies Last Post
DateTime Problem kwilliams ASP.NET 2.0 Professional 1 March 12th, 2008 01:36 PM
DateTime Problem!!! Pls help cmualo SQL Server 2000 4 August 17th, 2007 03:08 AM
Problem with DateTime and Textbox MAKO C# 5 July 28th, 2006 10:09 AM
DateTime problem acko Pro VB Databases 7 October 31st, 2004 05:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.