Please ,please please check my code

Results 1 to 2 of 2

Thread: Please ,please please check my code

  1. #1
    Join Date
    Dec 1969

    Default Please ,please please check my code

    1) In my ASP file I’ve built a chat room that goes on very well except for two problems that occur in the file that is called in the lower frame where the user types his message these problems are:<BR><BR>1- When the user presses “enter” to submit his message instead of the SUBMIT button my page is scrambled.<BR>What is the solution for this problem and if it’s by using something called TAB what is it and how is it used.<BR>2- If the message entered by the user contains the “ ‘ “ as in I’m there is an error, as if the ‘ is used like a closing for the string.<BR>The code that causes the error is :<BR><BR> conn.Execute("insert into Sudent_Chat (WhenEntered, Message) values (" _<BR> & "&#039" & Now & "&#039, " _<BR> & "&#039" & Session("Login") & ": " & Request.Form("St_Text") & "&#039)")<BR>

  2. #2
    Karl Guest

    Default RE: Please ,please please check my code

    in reverse order:<BR>2) before you insert the string into your database, convert all single quotes, to two single quotes:<BR>test = replace(Request.Form("St_text"), "&#039", "&#039&#039") and when you display it, just do the opposite (replace 2 single quotes with 1)<BR><BR>1) Take a look at for how to wire the "enter" key to submit in netscape. The TAB thing people are talking about is the key left of your "Q" on your keyboard..when you hit it, it scroll through the elements on your page and gives them focus.<BR>You might also want to take a look at which explains how to do it too.<BR><BR>--<BR>Karl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts