PDA

View Full Version : HELP! :- JavaScript problem


p9l
10-30-2003, 07:29 PM
Hi,I have a java script problem...
I have a javascript which concatenate the four drop down boxes.
function concate(fm,fy,tm,ty)
{
var QI00=fm.options[fm.selectedIndex].value;
var QI01=fy.options[fy.selectedIndex].value;
var QI02=tm.options[tm.selectedIndex].value;
var QI03=ty.options[ty.selectedIndex].value;
var QI0=QI00+QI01+QI02+QI03

}

how do I use QI0 again outside javascript??
this is what I mean!
<input name="QI0" type="hidden" value=?????>
I want this hidden field value as the QI0 value from the function!

HELP Pls.....

Jon Hanlon
10-30-2003, 08:23 PM
[code]

function concate(fm,fy,tm,ty) {
var QI00=fm.options[fm.selectedIndex].value;
var QI01=fy.options[fy.selectedIndex].value;
var QI02=tm.options[tm.selectedIndex].value;
var QI03=ty.options[ty.selectedIndex].value;
var QI0=QI00+QI01+QI02+QI03;
return Q10;
}

document.getElementById("Q10").value = concate(fm,fy,tm,ty);
/* OR */
document.forms.<<FORMNAME>>.Q10 = concate(fm,fy,tm,ty);

<input id="Q10" name="QI0" type="hidden" value="?????">

If you can't get it to work then please post the whole page.

Android
10-30-2003, 09:41 PM
Is that return Q10; or return QI0;?
Is that a 1 (one) or an I (uppercase 9th letter of the alphabet)?

p9l
10-30-2003, 09:51 PM
thanks.
I want the value of the hidden field to be the value QI0 from the function!
<input name="QI0" type="hidden" value=function return value>

p9l
10-31-2003, 12:57 AM
I have worked it out now!
Thanks guys..