keyongtech


  keyongtech > crm.* > crm.developer > 09/2007

 #1  
09-12-07, 11:40 AM
Phumulani
hi all

i have this code to update a date field: it is supposed to update the
birthday field in the onchange event of an id number field. what i get is an
error message saying "object does not support this property or method"
however if i use a normal text field it works fine. how do i get to use the
date field?

var Birthday = crmfom.all.new_idnumber.DataValue

crmForm.all.birthdate.DataValue = Birthday.substr(4,2)+
"/"+Birthday.substr(2,2)+ "/"+ "19" +(Birthday.substr(0,2));

thanx in advance
 #2  
09-12-07, 03:20 PM
Sanjeev Kumar
Hi Phumulani,

You can try the script below.

var birthdayDate = new Date();
birthdayDate.setDate(Birthday.substr(4,2));
birthdayDate.setMonth(Birthday.substr(2,2));
var year="19" +(Birthday.substr(0,2));
birthdayDate.setFullYear(Birthday.substr(0,2));

crmForm.all.birthdate.DataValue=birthdayDate;

Please let us know if it helped.

"Phumulani" wrote:
[..]
 #3  
09-12-07, 04:16 PM
Phumulani
hi Sanjeev,

it can now update the date field, however it doesnt include the "19" the
output is like 08/12/72 instead of 08/12/1972. this is how the client would
like it. Thank you very much though.
Similar Threads
How to enable an already disabled date field via Javascript

Per the form designer, I have a disabled date field. Trying to enable the field via Javascript. I can get the date selection working, but the text portion of the...

JavaScript Form Field Value Update Dilemma

Although I'm making an ajax call, this is really a javascript question (although it could be even more of an HTML or DOM question... not exactly sure) I'm doing an ajax call...

unable field Date and Lookup in javascript

Dear All, I have a simple request : I would like to know how it's possible to set unable the button control Date and the button control Lookup (but still visible) so as to...

Need to automatically update date in a date field when record info changes

I have a date field in a form that I'm using that I want to automatically update to the current date anytime I change any information in that record. Therefore, if the...

Update Date field to current date after duping the record

I am at a loss as to how I should perform an automated update of a date field after duplicating the record it is a part of. Example; Lets say I have a record with all of the...


All times are GMT. The time now is 08:28 PM. | Privacy Policy