?
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
Medium Priority
?
260 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
[X]
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
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 200 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 200 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

Featured Post

Major Serverless Shift

Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

762 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