Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

cold fusion form: When my dropdown field changes, how do I update a another field that shows the current date/stamp?

Posted on 2010-08-24
4
257 Views
Last Modified: 2012-05-10
I'm thinking this might be a job for Javascript.  Please provide some code examples.  

These two fields will be either inserted or updated into a Microsoft SQL Server 2005 database.

Thanks.
0
Comment
Question by:paultran00
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 50 total points
ID: 33514145
Yeah, this would be a job for javascript (see below)

BUT .. what is the 2nd field used for in your application?  If it's for anything important, I wouldn't recommend using javascript for the task.  Obviously it can be disabled and time settings vary from one user's locale to another.  For important values, it's better to use the server time.


<script type="text/javascript">
      function updateDate() {
            document.getElementById('otherField').value = new Date();
      }
</script>

<form>
      <select id="myList">
            <option value="1">option 1</option>
            <option value="2">option 2</option>
            <option value="3">option 3</option>
      </select>
      <input type="text" id="otherField">
</form>
0
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 50 total points
ID: 33514157
Typo correction. This line:
 <select id="myList">

Should be:
<select id="myList" onChange="updateDate()">
0
 

Author Comment

by:paultran00
ID: 33524277
Nice, it's working but it's not in the format that I need.  

Currently, it returns this format:  Wed Aug 25 10:51:56 MST 2010

Can you tell me how to make it this format:  08/25/2010 10:51
0
 

Author Comment

by:paultran00
ID: 33524368
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question