Weird single quote problem

Results 1 to 4 of 4

Thread: Weird single quote problem

  1. #1
    Ali Guest

    Default Weird single quote problem

    I have figured out how to &#039parse&#039 out the single quotes for SQL updates, but this one is stumping me. I have a name string from the SQL Server db like "O&#039Donnell". I populate a droplist fine with this name. If I select that name from the droplist, however, the request.form("txtName") returns just the "O". How do I get the entire name back?? Thanks in advance.

  2. #2
    Jason Miller Guest

    Default RE: Weird single quote problem

    Well, not knowing your methodology, the first thing I&#039d ask is "have you tried a replace(myStr, "&#039", "&#039;")?" HTML may or may not appreciate it. Alternately, have you tried an unParseApostrophe(replace(strIn, "&#039&#039", "&#039")) -- so<BR><BR>do while not myRS.eof<BR> response.write "&#060;option&#062;" & unParseApostrophe(myRS("Name")) & vbCrLf<BR> myRS.moveNext<BR>loop<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Weird single quote problem

    I&#039m betting that you replaced the single quote with double quotes when you populated the database. So when you populate the dropdown, it has double quotes. So the HTML looks like this ... value="O"Connel" ... meaning that there is an extra Connel hanging around not knowing what to do. Try replacing the double quotes with a single quote. i.e. replace(STRING, "&#039&#039", "&#039")

  4. #4
    Ali Guest

    Default RE: Weird single quote problem

    Thanks! Makes sense today. Must have been a Monday vacant brain.

Posting Permissions

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