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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Disabled input don't pass variable

    I wanted to create a form to update stored info on the DB.
    Since I wanted some of the things to not be changed I set the input of them as disabled.
    The thing is, as it's disabled, the PHP doesn't recognize it's variable.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,851
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Since I wanted some of the things to not be changed I set the input of them as disabled.
    The thing is, as it's disabled, the PHP doesn't recognize it's variable.
    form doesn't submit the disabled input controls. However you may use readonly attribute, if it suits for your needs.

    In fact, there is nothing hidden/readonly when it comes in the client side. Users can easily manipulate the client side source code. So, you must always validate all external data, before using them at server side.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    form doesn't submit the disabled input controls. However you may use readonly attribute, if it suits for your needs.

    In fact, there is nothing hidden/readonly when it comes in the client side. Users can easily manipulate the client side source code. So, you must always validate all external data, before using them at server side.
    Ok, thank you.
    I'll do what you said.


  •  

    Posting Permissions

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