code to capture first click of any field of the form

Posted by Ashsurve under jQuery on 6/10/2013 | Points: 10 | Views : 899 | Status : [Member] | Replies : 1
I have to fire below tracking; once on first click of any field of the form
$(document).ready(function () {
var s = s_gi(s_account);
s.linkTrackVars = "None";
s.linkTrackEvents = "None";
s.trackDownloadLinks = false;
s.trackExternalLinks = false;
s.linkTrackVars = 'prop1,eVar1,events';
s.prop1 = s.eVar1 = 'Registration form';
s.linkTrackEvents = 'event1';
s.events = 'event1';
s.tl(this, 'o', s.prop1);
});

So I want code to capture first click of any field of the form




Responses

Posted by: Cherishma on: 6/13/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,
Try This

$(function(){
$('form').one('click',function(e){
// the first click in the form
var s = s_gi(s_account);
s.linkTrackVars = "None";
s.linkTrackEvents = "None";
s.trackDownloadLinks = false;
s.trackExternalLinks = false;
s.linkTrackVars = 'prop1,eVar1,events';
s.prop1 = s.eVar1 = 'Registration form';
s.linkTrackEvents = 'event1';
s.events = 'event1';
s.tl(this, 'o', s.prop1);
})
})


Ashsurve, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response