SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how do I lock a value inot a an input form

    so i predetermine a value and I don't want a user to change it, any ideas?
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i would either "hide" the text box by making it input type="hidden" or disable it. I know this is supported by IE, not sure of Netscape support:

    frmName.txtBoxName.disabled = true;

  3. #3
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's predetermined, why do you want it in an input field?

    Like dethfire said you can have it hidden

    <input type="hidden" name="value name" value="your value">

    If you mean that you want to handle a user input which then locks you can do this by using a script to set any form field as 'read only'.
    I think I saw the script itself on Doc Javascript a while back.

    It is different from 'disabling' as disabling turns the field 'gray'.

    If you just want to do the first option check here.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  4. #4
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, i don't want to hide it, i want people to know it's there and what value it is, i will try your suggestions.
    Free Science Homework Help
    http://www.physicsforums.com


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
  •