Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute Query with onclick

Status
Not open for further replies.

martim07

Technical User
Nov 6, 2004
9
US
Hi,

I need to have the result of this query: <% sqlString = "SELECT EASE_OF_USE.EASE_OF_USE_DESCRIPTION FROM EASE_OF_USE INNER JOIN QUESTION_1_PHP ON EASE_OF_USE.EASE_OF_USE_ID = QUESTION_1_PHP.EASE_OF_USE_ID"

SET RS = Con.Execute( sqlString )

%>
<%=RS( "EASE_OF_USE_DESCRIPTION" )%>

display in a textarea when A user clicks on a button. I think that I need to write a function and then assign a variable to the onclick event, but I'm not used to programming at this level. I would appreciate any help with this.

Thanks
 
You can do this but only by reloading the page. Here's a simple example - not tested but should be OK.
Code:
[b]myPage.asp[/b]

<%
If Request.Form("showresult") Then
  sqlString = "SELECT......."
  Set RS = Con.Execute(sqlString)
  strResult = RS("EASE....")
  Set RS = Nothing
Else
  strResult = ""
End If
%>


<form action="myPage.asp" method="post" name="myForm">
<textarea><%=strResult%></textarea>
<input type="button" name="showresult" value="Show Result" onClick="document.myForm.submit();" />
</form>

Tony
________________________________________________________________________________
 
Thanks! For some reason, it is skipping directly to the "else" part of the statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top