/    Sign up×
Community /Pin to ProfileBookmark

Read Javascript variable in SQL select

Hi,
I’ ve this problem: I’ m not able to put the value of pippo variable inside SQL select. How can I do ??
Thanks a lot in advance !!!

<body>
<form>
<select name=”list_month” id=”list_month”>
<option value=”ALL” selected>ALL</option>
<option value=”January”>January</option>
<option value=”February”>February</option>
</select>
<script>
var pippo = document.getElementById(‘list_month’).value;
document.write(pippo);
</script>
</form>
…..
<%
Set objConn = Server.CreateObject(“ADODB.Connection”)
objConn.ConnectionString = “DSN=sal.dsn”
objConn.Open
strSQL = “SELECT * FROM ” & table & ” WHERE Month LIKE ‘%” & pippo & “%'”
Set objRS = objConn.Execute(strSQL)
….

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisAug 20.2007 — You seem to be missing a very important concept: ASP runs on the server (before being sent) and JavaScript runs on the client (after reception).
×

Success!

Help @il_betto 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.16,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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