Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Quick ASP/MySQL helpneeded.

  • 09-12-2008 04:06PM
    #1
    Registered Users, Registered Users 2 Posts: 7,466 ✭✭✭


    I have a simple form that inserts into a database. That works fine. I also have a webpage that displays the contents of the database. However, when I use the value of one of the database fields as the value of an input, if the user has entered more than one word, only the first word displays.

    So if the address value is say, 1 main street

    This will only display the 1 in the address
    Response.write "<input name=""address1"" value=" & Recordset("address1") &">"

    however this will display the full address
    Response.write "<td>" & Recordset("address1") & "</td> "


Comments

  • Registered Users, Registered Users 2 Posts: 2,494 ✭✭✭kayos


    Try
    Response.write "<input name=’address1’ value=’" & Recordset("address1") & "’>"


  • Registered Users, Registered Users 2 Posts: 7,466 ✭✭✭fletch


    kayos wrote: »
    Try
    Response.write "<input name=’address1’ value=’" & Recordset("address1") & "’>"
    Sorted it, thanks a million!!! :pac::pac::pac: Much appreciated


  • Registered Users, Registered Users 2 Posts: 7,466 ✭✭✭fletch


    Need a bit more help. Inverted comma's in names/address seem to be breaking it.

    Example the address "2 O'Callaghans Wood"

    This will display 2 O in the address input
    Response.write "<input name='address1' value='" & Recordset("address1") & "'>"

    however this will display the full address
    Response.write " & Recordset("address1") & "


  • Registered Users, Registered Users 2 Posts: 610 ✭✭✭nialo


    I usually use a find replace function on the recordset to remove this char and replace is it '. tis will take care of the problem i think.


  • Registered Users, Registered Users 2 Posts: 7,466 ✭✭✭fletch


    nialo wrote: »
    I usually use a find replace function on the recordset to remove this char and replace is it '. tis will take care of the problem i think.
    Once again boards to the rescue, I was replacing all instances of ' with '', replacing it with an ' as you suggest and it works fine! :):D Thanks a million!


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 610 ✭✭✭nialo


    no worries.

    some of the common characters ive had issues with and what there html match is.

    " -> "
    ' -> '
    & -> &


Advertisement