Return to Video

Hidden Inputs - Web Development

  • 0:01 - 0:03
    Okay, we're going to go back to our editor and add an
  • 0:03 - 0:07
    extra little feature here. Okay, so we're got our first input, type
  • 0:07 - 0:10
    equals text. I'm going to add a new input that we may not
  • 0:10 - 0:13
    have dealt with before called type equals hidden. And this is a
  • 0:13 - 0:17
    sneaky way of including values when you submit your form that
  • 0:17 - 0:20
    the user can't actually see. Sometimes when you submit a form you
  • 0:20 - 0:23
    actually want to have more information then what the user's just given
  • 0:23 - 0:26
    you. That's what type hidden is for. I'm going to give it name,
  • 0:26 - 0:29
    food and I'm going to give it value X. Okay,
  • 0:29 - 0:32
    back to the browser. I've refreshed our browser and
  • 0:32 - 0:36
    reloaded that new page. Now, I'm going to enter in
  • 0:36 - 0:40
    steak here again. And time for another quick quiz. What
  • 0:40 - 0:43
    happens when I click add here? What happens when
  • 0:43 - 0:45
    I submit the form, that has a hidden input
  • 0:45 - 0:48
    in it already? Do we see one value in
  • 0:48 - 0:51
    the URL with what we just submitted? Do we see
  • 0:51 - 0:55
    two values in the URL? The one we just submitted and the
  • 0:55 - 0:57
    hard coded value. In this case, the hard coded value, what I
  • 0:57 - 1:01
    mean by that is. The word eggs that we put in that
  • 1:01 - 1:05
    hidden input that was in our code. Or does the browser error?
タイトル:
Hidden Inputs - Web Development
概説:

08-03 Hidden Inputs

more » « less
Video Language:
English
Team:
Udacity
プロジェクト:
CS253 - Web Development
Duration:
01:07

English subtitles

改訂 Compare revisions