1. #1
    Donk is an unknown quantity at this point Registered User
    Join Date
    Feb 2006
    Location
    Gillingham
    Posts
    511
    Thanks
    0
    Thanked 4 Times in 1 Post

    help displaying £ in input form

    Hi I'm working on a currency database and have a input form to edit how each currency is displayed.

    However if I input "£" or "€" The actual symbol appears in the input form.

    eg <input value="&pound;" /> displays a box with the £ sign and not the long form.

    Any ideas how I can get round this?

    Any help would be appreciated

    Regards
    They came for my 404 and I said nothing

  2. #2
    Barry Typing with both fingers.
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    3,834
    Thanks
    215
    Thanked 143 Times in 108 Posts
    Use &amp;pound; ?


    Is that what you mean?

    Ta

  3. #3
    Donk is an unknown quantity at this point Registered User
    Join Date
    Feb 2006
    Location
    Gillingham
    Posts
    511
    Thanks
    0
    Thanked 4 Times in 1 Post
    The input form value is taken from a database.

    so the input line is actually:

    PHP Code:
    <input name="id" type="hidden" value="<?php echo $key?>">
    <input name="currency" type="text" size="20" value="<?php echo $currency[$key]['currency']?>" maxlength="20">
    The output is then sent back into the database.

    The value $currency[$key]['currency'] is the display form of the currency eg &pound; and is used to convert the ISO code "GBP" (id in input form) in the datafeed to display the correct currency.
    They came for my 404 and I said nothing

  4. #4
    Barry Typing with both fingers.
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    3,834
    Thanks
    215
    Thanked 143 Times in 108 Posts
    Maybe I am not getting what you need, however I will have a go.

    To display &pound; in a form field you will need to have the source code:-

    <input value="&amp;pound;" />

    or your example:-

    PHP Code:
    <input name="currency" type="text" size="20" value="<input value="<?php echo str_replace('&','&amp;'$currency[$key]['currency'])?>" />" maxlength="20">


    When submitted you will have to catch it and change &amp; back to just & then convert it back to your ISO codes.

    Sorry if this is not what ya need

  5. #5
    Donk is an unknown quantity at this point Registered User
    Join Date
    Feb 2006
    Location
    Gillingham
    Posts
    511
    Thanks
    0
    Thanked 4 Times in 1 Post
    Cheers the answer was so simple!! But I've spent hours trying to get round the problem.

    All sorted now I can get back to work.

    Thanks again.
    They came for my 404 and I said nothing

  6. #6
    Barry Typing with both fingers.
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    3,834
    Thanks
    215
    Thanked 143 Times in 108 Posts
    Had that similar problem and it took me ages as well

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Form spam problem
    By mibut in forum Programming
    Replies: 16
    Last Post: 07-02-07, 02:22 AM
  2. Form spammers - what to do!
    By smn2 in forum Affiliate Marketing Lounge
    Replies: 4
    Last Post: 12-09-06, 03:42 PM
  3. Replies: 1
    Last Post: 24-02-06, 01:17 PM
  4. Finance leads: own form vs merchants form
    By hiptophop in forum Affiliate Marketing Lounge
    Replies: 0
    Last Post: 29-09-05, 02:44 PM
  5. Lost password form on CJ website
    By woutermols in forum Commission Junction - CJ UK
    Replies: 0
    Last Post: 30-03-05, 07:18 PM

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2