Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    drop down menu help.

    I have a drop down menu and I was wondering if it was possible when someone submited my form it would delete something from the drop down menu.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Um...you want it to delete one of the options AFTER the form submission? Doesn't that defeat the purpose? Not that I don't believe you have a reason, but what are you trying to do?

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    its a online rpg and I dont want everyone to choose the same character.

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, so that when the next person visits, they can't select that option?

    Sorry, but you cannot do this with javascript. You need a server-side language, such as PHP

    Note: The option CAN be removed after submit, but it won't make a difference, because it will only affect the current user (i.e. it is removed from the run-time HTML) The next visitor will see the page with no changes.

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts
    actually u can, using cookies if cookie is there then take out option *read from cookie*....
    Computers are simple for the complex mind, yet complex for the simple mind

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, but that would only work if you assume that all the users are accessing the page from the same client machine (pretty unlikely, dont ya think?). A cookie on my computer will do nothing to affect a page when YOU view it.

    Oh, and I'd like to append a previous statment of mine. Javascript can be used server-side, but it has it's own set of variables/methods etc and is largely different from the client-side javascript most of us use. Besides, hardly anyone would recommend serverside javascript over PHP or Perl or something like that....

  • #7
    New Coder
    Join Date
    Jun 2002
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i don't know what u are talking about...

    cookies are saved onto a person's machine when they access a page, then the javascript will read that cookie when u visit again.... right?
    Computers are simple for the complex mind, yet complex for the simple mind

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by -sephiroth-
    its a online rpg and I dont want everyone to choose the same character.
    I'm assuming that he is making a form or something that his friends can use to create characters. If this is an online webpage, then cookies will do him no good. If they all meet at his house or at one machine, then it would work.

    Explanation:
    Lets say I visit this page and select a character. The page uses javascript to remove that option from the SELECT object, and saves a cookie to my machine with that info. If I re-visit the page, then that option will no longer exist (because the cookie said so ) Now, lets say that you visit the SAME page from YOUR computer for the first time. You will see all the orignal options in the SELECT object because the cookie on MY computer has ZERO effect on yours.

    So, essentially, if we relied on cookies to solve this problem, both you and I could select the same character, which means cookies really didn't solve it at all. Savvy?


  •  

    Posting Permissions

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