/    Sign up×
Community /Pin to ProfileBookmark

Save onClick Tracking To SQL Server

I am very new to JS and have a few tasks I would like to accomplish. I understand the basics, but that is about all.

-I want to be able to track when a user clicks an imagebutton and save that to a column in a database with the value of “true”

<script type=text/javascript>
var conn
conn=new ActiveXObject(“ADODB.Connection”);

var rst
rst=new ActiveXObject(“ADODB.recordset”);

sql=”UPDATE LinkCLick1 WHERE URL= URL”

conn.Open(“Connection string”);

rst.Open (sql, conn);

-Another task is enabling an imagebutton based off of two parameters, if a form is valid and depending on which radio button(s) are selected.

If (page.isvalid and rad1.checked) {
window.open(pdf1.pdf);
}
Else If (page.isvalid and rad1.checked and rad2.checked) {
window.open(pdf1.pdf) and window.open(pdf2.pdf);
}

The radio button are not in a group, so more than one can be selected. The use will make their selections, fill out the form, and then click the submit button. Upon submitting, I would like the selected values to automatically download.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@byeeeJul 30.2007 — ... do you really need to use ActiveX? Most people have that disabled for security reasons. What kind of scripting language do you use server-side?
Copy linkTweet thisAlerts:
@mcfly1204authorJul 30.2007 — I do not need ActiveX, as stated, this is new to me. I originally looked to do everything in the code behind file in c#. If I can accomplish what I want in C# then that would be great. However, I began looking into javascript for performance reasons. Any advice would be greatly appreciated.
×

Success!

Help @mcfly1204 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...