470,618 Members | 1,721 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,618 developers. It's quick & easy.

How to insert a Dynamic Value into a javascript?

I've tried and tried, and thought I had it figured out, but still the
results indicate that I'm wrong.

Help is appreciated. I'm merely trying to grab a value from a form and
insert it into a javascript. Any hints as to what's wrong with the
code below?

Request.form("AMOUNT") as used below does not bring my value into the
javascript (This is related to GoToast ROI Conversion tracking).
<script language="javascript">
<!--

if (typeof(ROIID) + '' != 'undefined')
{
TrackEvent('Sale', request.form("AMOUNT"));
}
//-->
</script>
Jul 20 '05 #1
1 4421
wa***@wapro.com (Terry) writes:
I've tried and tried, and thought I had it figured out, but still the
results indicate that I'm wrong. Help is appreciated. I'm merely trying to grab a value from a form and
insert it into a javascript. Any hints as to what's wrong with the
code below?
The way to get the value of a form control is:
document.forms['formId'].elements['controlName'].value
Request.form("AMOUNT") as used below does not bring my value into the
javascript (This is related to GoToast ROI Conversion tracking).
I have no idea what "request.form('AMOUNT')" is supposed to do, or what
the names mean. Is "request" the form id and "AMOUNT" the control name?

In that case, forms don't have a form property, and it sure isn't a
function.
<script language="javascript">
In HTML 4, the type attribute is required (and sufficient), so use
<script type="text/javascript">
<!--
HTML-like comments are not necessary.

if (typeof(ROIID) + '' != 'undefined')


You don't need to add '', the typeof operator always gives a string.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Lelle | last post: by
3 posts views Thread by Mukesh | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.