We help IT Professionals succeed at work.

How to add multiple Javascript Variables together

monosyth
monosyth asked
on
This is only updating my form actions for the first variable, not the second, does this need to be written differently?

<script type="text/javascript">
function update10()
{

document.getElementById("10Preview").action = 'PropertyApp/viewtemplate.cfm?code=code10&FloorplanID=' + document.form10.FloorplanID.value; + '&theme=' + document.form10.theme.value;

document.getElementById("10PDF").action = 'PropertyApp/pdftemplate.cfm?code=code10&FloorplanID=' + document.form10.FloorplanID.value; + '&theme=' + document.form10.theme.value;

document.getElementById("10Email").action = 'PropertyApp/email_form_template.cfm?code=code10&FloorplanID=' + document.form10.FloorplanID.value; + '&theme=' + document.form10.theme.value;

document.getElementById("10WebFlyer").action = '/flyers/WebFlyer_Apt.cfm?ID=#Userinfo.id#&code=code10&FloorplanID=' + document.form10.FloorplanID.value; + '&theme=' + document.form10.theme.value;

return;
}

</script>
Comment
Watch Question

SILVER EXPERT
Expert of the Year 2008
Top Expert 2008
Commented:
you have:
...document.form10.FloorplanID.value; +...

get rid of those semicolons to the left of the +
<script type="text/javascript">
function update10()
{

document.getElementById("10Preview").action = 'PropertyApp/viewtemplate.cfm?code=code10&FloorplanID=' + document.form10.FloorplanID.value + '&theme=' + document.form10.theme.value;

document.getElementById("10PDF").action = 'PropertyApp/pdftemplate.cfm?code=code10&FloorplanID=' + document.form10.FloorplanID.value + '&theme=' + document.form10.theme.value;

document.getElementById("10Email").action = 'PropertyApp/email_form_template.cfm?code=code10&FloorplanID=' + document.form10.FloorplanID.value + '&theme=' + document.form10.theme.value;

document.getElementById("10WebFlyer").action = '/flyers/WebFlyer_Apt.cfm?ID=#Userinfo.id#&code=code10&FloorplanID=' + document.form10.FloorplanID.value + '&theme=' + document.form10.theme.value;

return;
}

</script>

Open in new window

Explore More ContentExplore courses, solutions, and other research materials related to this topic.