+ Reply to Thread
Results 1 to 6 of 6

 

Thread: help displaying £ in input form

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Feb 2006
    Location
    Gillingham
    Posts
    510
    Thanks
    0
    Thanked 4 Times in 1 Post


    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
    Typing with both fingers.

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    4,122
    Thanks
    246
    Thanked 197 Times in 156 Posts
    Use &amp;pound; ?


    Is that what you mean?

    Ta

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Feb 2006
    Location
    Gillingham
    Posts
    510
    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
    Typing with both fingers.

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    4,122
    Thanks
    246
    Thanked 197 Times in 156 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
    Registered User

    Status
    Offline
    Join Date
    Feb 2006
    Location
    Gillingham
    Posts
    510
    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
    Typing with both fingers.

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    4,122
    Thanks
    246
    Thanked 197 Times in 156 Posts
    Had that similar problem and it took me ages as well

+ Reply to Thread


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
    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
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2