I need some help with Java Script

Discussion in 'Java Script/AJAX' started by Orion, Oct 6, 2009.

Remove these ads by signing in
Remove these ads by signing in
Thread Status:
Not open for further replies.
  1. Orion New Member

    Member Since:
    Sep 29, 2009
    Message Count:
    969
    Likes Received:
    25
    Location:
    http://admin-spot.com
    Well, on my forum (I'm using a free host) I am try to make it so that no one can change their display name on their account. So far, I've been able to do so. I the name change box in their profile is disabled, but they can't change anything else in their profile since the server doesn't register anything in the "Name" text box.

    My board is blkfireforum.suddenlaunch3.com. If you don't undertstand, you can make an account and look under profile. At the moment, I've removed the code, so anyone can change their display name freely.

    Does anyone know how I can alter, or rewrite my code so that users can't change their name, but can change the rest of the items in their profiles? Any help is MUCH appreciated.

    Here's my code:

    <script>
    if(location.href.match(/action=profile&/i)) {
    var INP = document.getElementsByTagName('INPUT');
    for(inp=0; inp<INP.length; inp++) {
    if(INP[inp].name == "name")
    INP[inp].disabled = "disabled";
    }}
    </script>

  2. Orion New Member

    Member Since:
    Sep 29, 2009
    Message Count:
    969
    Likes Received:
    25
    Location:
    http://admin-spot.com
  3. Neha New Member

    Member Since:
    Sep 4, 2009
    Message Count:
    10
    Likes Received:
    0
    hello Dear

    I understand and able to do what you said. May i assist u for this?

    Regards
    Neha
  4. Orion New Member

    Member Since:
    Sep 29, 2009
    Message Count:
    969
    Likes Received:
    25
    Location:
    http://admin-spot.com
    Well, I've switched to a better service. The old one was flawed, not matter how much I tried to alter the code, it wouldn't work properly.
  5. Zoli New Member

    Member Since:
    Jan 23, 2007
    Message Count:
    563
    Likes Received:
    37
    Location:
    Hungary
    Hi,

    I think you should not play with javascript since it is an optional client side programming language. You should control the operation rather on server side in the php files. Maybe you should just remove the name input from the template file.
    Regards
  6. Orion New Member

    Member Since:
    Sep 29, 2009
    Message Count:
    969
    Likes Received:
    25
    Location:
    http://admin-spot.com
    I was using a free host where I don't have access to server side operations. Therefore, to customize anything, I would have to use the basic software, or edit the code myself.
  7. Zoli New Member

    Member Since:
    Jan 23, 2007
    Message Count:
    563
    Likes Received:
    37
    Location:
    Hungary
    Do you have the power to manage the template files? If you do try removing the name changing block from it. I think this is the easiest and most secure way. Of course you will need to create backup first, since you may never know...
  8. Orion New Member

    Member Since:
    Sep 29, 2009
    Message Count:
    969
    Likes Received:
    25
    Location:
    http://admin-spot.com
    Nope. All I could do was edit scripts (or add new ones).
  9. Orion New Member

    Member Since:
    Sep 29, 2009
    Message Count:
    969
    Likes Received:
    25
    Location:
    http://admin-spot.com
    Anyway, I don't use that forum host anymore.
  10. Zoli New Member

    Member Since:
    Jan 23, 2007
    Message Count:
    563
    Likes Received:
    37
    Location:
    Hungary
    When I get home I will look into your script, but it won't be perfect solution since operates only on client side.
  11. Orion New Member

    Member Since:
    Sep 29, 2009
    Message Count:
    969
    Likes Received:
    25
    Location:
    http://admin-spot.com
    You don't have to lol. I mean, if you want to post it in their support boards (support.suddenlaunch.com), feel more than welcome to. I heard they're looking for a new coder, but I don't know if it's a paid job or only for volunteers.

    I no longer use that free forum host, as I've found a better one, which I am quite satisfied with at the moment.
  12. Zoli New Member

    Member Since:
    Jan 23, 2007
    Message Count:
    563
    Likes Received:
    37
    Location:
    Hungary
    The site did not send me the validation link after registration so I leave this. Otherwise I'm not a coder, but thank you.
  13. Orion New Member

    Member Since:
    Sep 29, 2009
    Message Count:
    969
    Likes Received:
    25
    Location:
    http://admin-spot.com
    No problem, thanks for the help.
Thread Status:
Not open for further replies.

Share This Page