Jump to content

[SOLVED] Combine Field Values into an Alert


TRI0N

Recommended Posts

Well knowing how to do this will be nice to know even for other aspects of things I will need to accomplish.

 

alert('Date is: '+ step3.d_month.value +'/'+ setp3.d_day.value +'/'+ step3.d_year.value) ;

Okay now why does this not work?

 

I assumed 'step3' is your form name.

Please try this:

document.step3.d_month.value;

 

hope this work

Well yes that will work but not what I need.

 

alert('Date is: '+ step3.d_month.value ) ; //WORKS

 

alert('Date is: '+ step3.d_month.value +' Month') ; //WORKS

 

alert('Date is: '+ step3.d_month.value +'/'+ setp3.d_day.value +'/'+ step3.d_year.value) ; //DOES NOT WORK

 

It should create an Alert that says:

 

Date is: 05/22/2007

 

 

 

i have just created this on my system and it works

var tday = "22";
var tmonth = "05";
var tyear = "2007";
alert ("Date is: " + tday + "/" + tmonth + "/" + tyear);

 

so as long as you variables work then change the t variables in mine with your own and all things being equal it should work fine, I realise it is not different from yours, I had trouble to start with but the javascript error console in firefox is a great tool

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.