How is "hidden value" in form being used

Discussion in 'HTML & Website Design' started by askscript, Nov 9, 2008.

  1. #1
    <input type="hidden value" ...>

    How is this hidden value used?

    I read from a book saying that it is used when 2 forms a link together and the data is passed on to the 2nd form as hidden value.

    How is it coded in a situation where data should be hidden? any example? I can't find much from the sources i gather.
     
    askscript, Nov 9, 2008 IP
  2. rene7705

    rene7705 Peon

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sry wtf do u mean dude?

    i usually use hidden values to describe state about a form that the user doesn't need to see.
    For instance which tables and records the form data apply to.
     
    rene7705, Nov 9, 2008 IP
  3. ASPMachine

    ASPMachine Peon

    Messages:
    723
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Follow the url http://borolook.com/free_directory_list.asp and go through all the category and subcategory and click at the Add Here link. You'll get a directory submission form where you've to put Full Name, Email, Country, Title, Description, URL and Page URL. But I'm also saving the main category and sub category as you see on the top of the form. Here you don't need to put the category on form. This category value that you're followed to reach to the submission form is on the hidden form value. When you submit the form, the category value also save to database with your site information. You may see the source code of the form....you'll able to see the value to main category and sub category.

    Hidden values are just use to make default value of a form which we don't make visible for end users to fill.
     
    ASPMachine, Nov 10, 2008 IP
  4. askscript

    askscript Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    sorry for the confusion. i see it is like a comment.

    How do you code that in that situation?
     
    askscript, Nov 10, 2008 IP
  5. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    like this..

    
    
    if (isset($_POST['submit']))
    {
          // handle the form
    }
    
    else
    {
          // display the form..
          // the form will submit to itself and have a hidden input called "submit" with a value set to 1
    }
    
    
    Code (markup):
     
    garrettheel, Nov 10, 2008 IP
  6. deemainer

    deemainer Active Member

    Messages:
    351
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    78
    #6
    paypal buttons are another good example.The hiden value is used to pass on price,postage info etc.
     
    deemainer, Nov 10, 2008 IP