Results 1 to 5 of 5

Thread: how to remove 3 letters from <option value="F-firstname" ? Simple question

  1. #1
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to remove 3 letters from <option value="F-firstname" ? Simple question

    Hello,
    I have code for option like:
    PHP Code:
    <option value="F-myname" >

    $option "'F-myname'";
    $option substr($option3); 
    How to remove it without using variable $option as I have 100 items for variables and it is hard to name variable $option each time.

    Need help
    thank you

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I don't understand. Can you give more info?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    thank you.
    I'm sorry I was not clear. I have List box with code as above:
    <option value="F-myname" >

    I would like to store to variable with name like mynames without characters F- but it needs to be in List box as it is <option value="F-myname1" >

    List box is like:
    <select name="mynames" >
    <option selected value="">Please select...
    <option value="F-myname1" >Myname1</option>
    ...

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You can't just magically have the name of a variable be different.

    What you could do (probably when receiving the info later, not with Javascript on the page) is split it to get the name, then save the data into the new variable and clear the old one.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi, I have solved, thank you

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
  •