Link to home
Start Free TrialLog in
Avatar of JElster
JElsterFlag for United States of America

asked on

Classic ASP - Help getting hidden value

I have a hidden value on a page.

    <input type="hidden" name="noteId" id="noteId"/>

I can 'see' the value in the HTML.   Next I need to get that value to run a query.
But the following next line is always null

<%
   Response.write(request.form("noteId"))

' Run query based on noteId HERE

%>

Any ideas what I am doing wrong?

thx
SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JElster

ASKER

It's as simple as this...   How can I get the value in Jquery and pass it to the query below?
thx

    <input type="hidden" name="noteId" id="noteId"/>
                              <br/>

                   <!-- Get Current Note Record -->
                         <%       
                       if NOT(IsNull(request.form("noteId")) or request.form("noteId")="") then
                   
                            strSql = "SELECT * FROM NOTES WHERE NOTEID = " + request.form("noteId")

                          'Test
                            Response.write(strSql)
You can't do that directly with javascript/jquery.  I do see an issue with your if statement.

   if NOT(IsNull(request.form("noteId")) or request.form("noteId")="") then

should be

   if NOT(IsNull(request.form("noteId")) AND request.form("noteId")<>"") then

Is a form being submitted here? or do you need to use the value that is typed into   <input type="hidden" name="noteId" id="noteId"/>?  If that is the case, we need to use ajax where we use javascript/jquery to grab the value entered and submit to another asp page, grab the output and bring it to the current page or redirect to another.
Avatar of JElster

ASKER

Any way put the noteID in a session using JS and just call  Session("noteID");
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial