View Full Version : Updating a form value

05-27-2012, 07:42 PM
Hi All,

I have a popup calendar that I want a user to be able to click a date and for it to update a field on the previous page.

I've tried the following code:

function updateDate(){
window.opener.document.getElementById(startdate).value = "12/05/12";
return false;

but when clicking on the date nothing at all happens.

I'm trying to get it so that any part of the DIV can be clicked on and the field I want to update is startdate, the code I'm using inside my DIV tag is


I'm very new to javascript so probably doing something very stupid!

Thanks in advance

Philip M
05-27-2012, 07:48 PM
window.opener.document.getElementById("startdate").value = "12/05/12";If "startdate" is the id of a field then then is a literal which must be in quotes.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

05-27-2012, 07:53 PM
I knew it would be something stupid!!

Thanks very much