Trouble concatenating varables to a string
Hi all, I am having an issue with concatenating some variables to a string value. It seemed to work fine in other instances so I'm not sure what I'm doing wrong here. The issue is with the "prompt1" variable and the string within it. I have these IF statements that populate the idx, idxCat and idxBrand variables which I want to then concatenate in specific spots in the prompt1 string, however it does not seem to be working and just prints +idx+, +idxCat+ etc... instead of the value. I did an alert to check to make sure that the idx variables are in fact being populated and they are. Is this just some weird syntax thing?
Below is the code snippet:
if (idx == 0)
{
idx = "";
}
else
{
idx = ":"+vsel;
}
if (idxCat == 0)
{
idxCat = "";
}
else
{
idxCat = ":"+vcat;
}
if (idxBrand == 0)
{
idxBrand = "";
}
else
{
idxBrand = ":"+vbrand;
}
prompt1='&elementsPromptAnswers=8D679D3711D3E4981000E787EC6DE8A4;8D679D3711D3E4981000E787EC6DE8A4+idx ,8D679D3611D3E4981000E787EC6DE8A4;8D679D3611D3E4981000E787EC6DE8A4+idxCat,54BABECD11D59D57C000B28A4CC5F24F;54BABECD11D59D57C000B28A4CC5F24F +idxBrand';
//frames[0].location.href = mstrURL + prompt1;
alert(prompt1);