Solved! Go to Solution.
Views
Replies
Total Likes
arob87 wrote...
$("input[name='loanAmount']").mouseleave(function(){
var loanAmount = $("input[name='loanAmount']").val();
if (loanAmount.length){
s.events= "event100:"+loanAmount;}
else {
return false}
});
You need to add a colon for event serialization and take the variable name out of quotes so that the variable passes through
Thank you, this worked perfectly.....
Views
Replies
Total Likes
assume you're using jQuery from the above and that name="loanAmount" is always consistent so could you not use the following selector?
$("[name='loanAmount']").....
Views
Replies
Total Likes
arob87 wrote...
assume you're using jQuery from the above and that name="loanAmount" is always consistent so could you not use the following selector?
$("[name='loanAmount']").....
I guess I could. I'm not very good at Jquery, so could you elaborate a little bit more with the code?
Views
Replies
Total Likes
OK I see what you are saying. That would allow me identify the element, however how do I take care of this part of the code
var loanAmount = $this("#uid_loanAmount_") ; This is where the data is being stored. So how do I pull it from here. I'm not really good with HTML, so unless you are saying that the input value is some how stored within all parts of the element. I'm not sure how I can pull the input data from the element meaning I could do this -> var loanAmount =$this(name='loanAmount') and it would extract the input value.. lets say its $305,000..
Views
Replies
Total Likes
Darius Dempsey wrote...
arob87 wrote...
assume you're using jQuery from the above and that name="loanAmount" is always consistent so could you not use the following selector?
$("[name='loanAmount']").....
I guess I could. I'm not very good at Jquery, so could you elaborate a little bit more with the code?
Could I do something like this and use a wild card in place of the id #
$("[name='loanAmount]").mouseleave(function(){
var loanAmount = $this("#uid_loanAmount_* "); <--
if (loanAmount.length){
s.evar17 = loanAmount_ }
else (// do something
return false;
});
Views
Replies
Total Likes
I'm also assuming you don't have DTM and this is going directly on the page so you'd have something like:
$("input[name='loanAmount']").mouseleave(function(){ var loanAmount = $("input[name='loanAmount']").val(); if (loanAmount.length){ s.eVar17 = loanAmount } else { return false} });
Views
Replies
Total Likes
Actually I am using DTM, but I cannot use the CSS Selector on this page. But I am using the Custom page Code in DTM to implement this.
Views
Replies
Total Likes
so this script works
$("input[name='loanAmount']").mouseleave(function(){ var loanAmount = $("input[name='loanAmount']").val(); if (loanAmount.length){ s.events= "event100 = loanAmount "} else { return false} });
but the s.events portion does not capture the numerical value stored in the variable loanAmount.. I am not sure how to pass it to an s.event variable. I did verify that the numerical value is being captured in this script because I passed it to an s.prop variable to test it. and it pulls the acutally numerical value that is typed into the input box. But it does not pass it to the s.event variable. what I get instead is the literal text "loanAmount" <- this is what shows up in the s.event variable. I also set the s.event to currency. So can anyone suggest how to pass the actual numerical integer to the s.event variable.
Thanks
Views
Replies
Total Likes
$("input[name='loanAmount']").mouseleave(function(){
var loanAmount = $("input[name='loanAmount']").val(); if (loanAmount.length){ s.events= "event100:"+loanAmount;} else { return false} });
You need to add a colon for event serialization and take the variable name out of quotes so that the variable passes through
Views
Replies
Total Likes
arob87 wrote...
$("input[name='loanAmount']").mouseleave(function(){
var loanAmount = $("input[name='loanAmount']").val();
if (loanAmount.length){
s.events= "event100:"+loanAmount;}
else {
return false}
});
You need to add a colon for event serialization and take the variable name out of quotes so that the variable passes through
Thank you, this worked perfectly.....
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies