Hi guys Just a quick one for those of you who are good with JavaScript. Can you convert this Visual Basics IF statement into JavaScript for me please. I've had a few goes at doing it myself but i must have had the syntax wrong. All help is very much appreciated. Thanks, Sam. Just a quickie <% if n > 0 then oRsAnswers.Move(nSelected - 1) Response.Write oRsAnswers ("Answers") end if %> Code (markup):
If you're asking how to do a database recordset operation in javascript, then it's not possible. The ASP code you posted is run server-side. Javascript is run client-side, and doesn't have access to your database. If you're just asking how to write an if statement, then: <script type="text/javascript"> if (n > 0) { // do something, but not if that something deals with db recordsets } </script> Code (markup):