Skip to main content
Inspiring
July 8, 2009
Question

Passing Database Field with Double Quotes through a Form Field

  • July 8, 2009
  • 1 reply
  • 578 views

Hey All,

    I am trying to pass an Access database product description field that contains records with single and double quotes through a hidden form field but as soon as the database encounters a double quote (be it used as a delineation for inches or an actual quote), it ignores passing the rest of the description on beyond that point it encountered the quote. Here is an example:

Here is the Form Field: <input type="hidden" name="item_name" value="<%=(rs_MS2.Fields.Item("Description").Value)%>">

Here is the actual description: OPW 3/4" Reconnectable Breakaway

Here is the incomplete description being passed on through the hidden form field: OPW 3/4

It stops right where the double quote should be.

I am SURE there is a way to code around this problem to bring over the double quote and rest of description; I just don't know what it is and what I have found in my search on the web has been vague at best.  Any help or direction would be greatly appreciated.

Thanks!!

Andy

This topic has been closed for replies.

1 reply

Inspiring
July 8, 2009

Beat your head against the wall long enough and sometimes you pound some sense through.  I figured out my problem and it seems to be too simple..lol:

Here is the original form field: <input type="hidden" name="item_name" value="<%=(rs_MS2.Fields.Item("Description").Value)%>">

I replaced the double quotes surrounding the recordset field value with single quotes so it now looks like this:

<input type="hidden" name="item_name" value='<%=(rs_MS2.Fields.Item("Description").Value)%>'>

Andy