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 2 of 2
  1. #1
    Regular Coder StealthRT's Avatar
    Join Date
    Aug 2006
    Posts
    185
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Question Drawing a blank here... set a var within document.XXX

    Hey all for some reason i am drawing a blank at how to go about doing this.
    Code:
    var theTxtBox = "txtFName";
    var theIFrame = "FNameFrame"
    
    document.FNameFrame.txtFName.value = document.FNameFrame.txtFName.value + '@';
    I want to replace the document.FNameFrame.txtFName. with the var's so that i can only change one thing instead of my whole code (which is pretty log already)

    How can i do this?

    Thanks!
    David

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,910
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    I don't think it is possible to change the name of an element. It is possible to change the type (e.g. from text to password).


  •  

    Posting Permissions

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