0:00
okay microphone sorry about that i had some weird issues
0:06
i don't know it was uh it was funky um as usual some technical difficulties today let me
0:13
close this window that i fixed my lights
0:20
okay there we go that looks better you know i tried to reboot my mac like i
0:27
don't 20 minutes ago decided it wanted to take like 15 minutes to reboot i was like what the heck
0:32
right um so sorry about that and then like everything booted up and
0:37
then my lights didn't want to turn on it was man oh well fun times
0:44
um so yeah how's everyone doing today frederick thank you for coming on from
0:49
good old france bill francis good to see you the goat prince always horrible to see you as well thank
0:56
you mr goat prince um rihann thanks for coming chris and
1:01
daniel levine or levin levine levin
1:08
oh it's mark levin right is that is that it's the commentator okay um same issue
1:14
as me big sir no comment yep yeah weird not sure what's going on uh you know
1:19
completely side note i i did notice you know uh apple at wwdc this week all kinds of new fun gadgets and all
1:25
that jazz right new um or not new gadgets but new goodies in the os and um apparently
1:33
for us that own intel max some of those really cool new features we don't get to get those so apparently
1:40
some of those are only going to be for m1 max so
1:45
oh well kind of sucks right i'm not sure if there's legitimacy there
1:52
for having those or not or i don't know man i have to say this one gray hair right here is getting pretty big
1:58
look at that guys oh watch out watch out there gone i got it
2:07
sorry i was just looking like oh whatever danny grizzle
2:14
listening from texas thanks danny okay um so today we're gonna be going over
2:20
some foundation form stuff um a lot of this if you were on the hangouts i don't know it was like a
2:26
month or two ago to be honest um i did some really um some really cool
2:32
stuff and um i i made it better by shipping some some updates and i've been wanting to do it on a live
2:38
stream and to talk about um some multi uh multi-page forms
2:44
multi-step forms two different things okay um and then also we'll go over um
2:50
we'll start off with something a little bit easier um i thought it'd be fun to um
2:56
to show you something i helped someone out with um not too long ago um has to do with forms so it is
3:01
relevant to today so um anyway cool
3:07
uh jason thanks for coming on today bud franco thanks for coming on good to see you guys um without further
3:13
ado let's go ahead and uh let's share my screen oh i did not change my screen resolution today
3:20
oh i got all frantic because um do i want to try to change it on the
3:26
fly let's let's see i don't know i haven't had good good luck doing that in the past but let's see
3:32
um let's see let's see
3:37
scaled this is going to completely bonk the live stream
3:52
hold on okay i know you guys are seeing something a little funky but let me go ahead and do
3:58
this voila and then we go live
4:05
there we go hopefully that's going to work i don't know hopefully all right let's
4:11
see let's open up a wrap of your window um see how big it gets
4:21
um
4:27
yes exactly today's live stream is all about how to handle it's all about let's not panic let's not
4:33
swear right let's keep a child friendly
4:39
[Music] okay um actually this this has nothing
4:44
to do with forms but i built this this morning as well for um i posted the url to this on the community
4:51
someone wanted in foundation six to create a little um two-column layout where this side was a
4:57
slider um and then the the size of the image here was basically based on the text
5:03
over here right so um yeah there we go so it doesn't matter what it is and on
5:09
you know yeah kind of cool i like it so that it's always two columns and on mobile it goes
5:15
small and um we have a slider and uh yeah pretty slick
5:20
um i put the uh here let me see if i can still get the uh to to copy the link i'll put this in
5:28
the chat if you guys want this project file um but yeah it's a i'm not going to go over
5:34
everything essentially what it does is um it uses a slider um the foundation 6
5:40
slider and then basically the slides the image is actually a background image
5:46
okay so um they're all background images and the reason i'm using a background image images so that it it just properly
5:53
scales and yes the parts of the image get cropped off
5:58
but it as you see it doesn't really matter the size it always stretches you always see some
6:05
of the image you always see all of the text right and they're all matched up in this nice
6:10
little container box right so pretty cool there um so yeah and it's a slider so there we
6:17
go um so yeah uh there's the project file um there there is some tricky um this this is the magic
6:25
um this swatch here the height swatch because essentially what we need to do is we need to um set the height of the slider and all
6:33
of its slides to be 100 um so that this is the magic bullet right
6:40
here this is the one and then these ones just generic background slides or background swatches that we apply to each slide so
6:48
there you go the magic is this height swatch though there we go i'll probably turn this into
6:54
a template maybe in the next one the next um thing actually you know what before i forget let's just go ahead and
7:01
i'll create a template out of this now so i don't forget and we'll just do two column
7:09
plus slider something like that
7:16
there we go i'll just call it two call plus slider that way i remember what it was and it's a template that i can easily
7:22
add to the future uh future thing there we go um
7:28
cool all right that wasn't purpose that was just i just happened to open up that project file to get rapidly going so let's just close
7:34
that uh don't save it okay and um actually i want to see if i can open up
7:40
this sandbox project because i think i have if you know it i shouldn't start for my sandbox project
7:46
because i just want to start this from from normal i actually know but it has like all my publishing stuff
7:52
so we'll start from scratch let's start
7:57
from a brand spanking new project file crappy uber seems to be behaving now um i don't think it was rap reviewer's
8:02
fault what we were having earlier in the live stream my mac was funky um so okay
8:10
forms oh but my i do have some swatches in this sandbox project that i wanted to
8:15
show off a little bit so let's open that up
8:21
it's in here yes one two three
8:27
four right
8:38
yes all right
8:46
all right let's go ahead and i'm just going to copy the site styles and we'll paste it in here
8:54
didn't need this one okay um so there was user um actually i think it
9:00
was uh gary wong and he wanted to display
9:07
[Music] change basically the button
9:13
of the foundation button in a form based on whether or not a
9:19
form was successfully submitted or if there was an error or things of that nature okay so um
9:27
let's go ahead and let me just build out a quick little form here
9:32
i'm just gonna do this and we'll delete the text let's just go ahead and add we're going
9:38
to start from the contact form template
9:43
contact form start here okay and let's just go ahead and extract that
9:51
extract okay there we go sweet um
9:57
we're not going to be playing with email um at all today actually so i'm just going to delete the email action
10:08
so forms when there is an error on a form let's
10:15
say we want to change this particular button okay we want to change this to be error or things of that nature and
10:23
what this is going to be using is it's going to be using something called pseudo content
10:30
okay and uh this is a this is a swatch that's from the swatch pack okay and um what it allows us to do is
10:39
it allows us to use css to modify the content of something
10:44
okay so um if we go ahead if we notice here we have um state button before so essentially what
10:51
we want to do is we're going to play around with this button and i'm going to add a class called state button state dash
10:57
button okay um and let's just go ahead and preview that really quick
11:02
what we'll notice here is um we have the preview says submit submit
11:09
right well that's because um here we have sudo content before and let's just do um
11:15
hello live stream okay so in the pseudo in the actual content now the important part here is
11:22
you have to have the quotes okay keep those in there
11:27
we'll notice that we have hello live stream submit okay this is just adding pseudo content
11:34
to the state button there's nothing else there's no other fancy stuff in here um this just kind of gives you an idea
11:40
of what pseudo content can be now um what if you notice here we have this pseudo element is called
11:46
before and the button itself has the word submit on it right that's the label on the button and
11:53
so the pseudo content before adds content before um the content so this works on
11:59
buttons it works in headers it works in all kinds of places okay um
12:06
and just to show you if we did this instead of before we set this to use the after okay this does submit hello live stream
12:15
okay but um we don't want that right um so we just
12:22
want whatever the pseudo content is oops um
12:29
let me save this project file step forms okay
12:36
um so here what i want to do is let's let's change this content back to submit
12:48
okay and i wanna i'm gonna use it before um and then what we're gonna do is here in this button i'm just gonna delete the
12:54
label okay now for accessibility purposes this button is blank
12:59
and that doesn't help people with accessibility right so what we need to do is we need to um
13:04
choose accessibility labels and we need to add this add an accessibility label since we
13:10
removed the label of the button okay i'll just call this submit form now
13:16
this accessibility label doesn't display anything it just tells accessible readers what
13:22
this button does okay by default it uses the label but since we deleted the label we want
13:30
to make sure we have an accessibility label okay let's preview this
13:36
if we notice the button even though we deleted labels says submit that's because we're injecting that with
13:42
css with a swatch okay so we're injecting the submit okay
13:48
now these other cool um cool stacks here let me go ahead
13:55
and okay um so we have this these other cool stacks uh pseudo content stacks and you'll
14:03
notice that um what it does differently is it has a parent class set so it we're styling the state button and
14:10
remember we added the state button class to the actual button in the in our in our form okay
14:17
now if you ever forget this if you hover over the parent class there's the tool tip that has a bunch of some kind of special
14:25
parent classes that you can use okay and if we look here under forms only oops i can't move my mouse but if
14:32
we if we look under forms only you'll see that there are three classes
14:37
um that you can um put inside this parent class if you want to affect some cool things
14:44
with form okay um so in this case what i can do is i'm going to say when the form is processing
14:50
so we have the processing class that gets added to the form when the form is actually in the process
14:57
of submitting okay um and then this particular one
15:03
we're using the parent class of success and guess what that class is added to the form when the form
15:09
has been successfully submitted and then lastly if there is an error so
15:16
the form will get an error class if the form has an error submitting
15:24
okay so um just to kind of and if if you look here when we are
15:30
processing i'm going to change the content of the button to say submitting and then here when it's
15:37
successful i'm going to change the button to say thank you right because this we're using swatches
15:44
to override the content so the default again here is submit but then when when we have processing
15:52
when the form is processing it's going to say submitting when the form is successful
15:57
it'll say thank you and if there's any errors it'll say oh no okay
16:03
now just to save us time i'm not going to try to replicate these states by you know actively sending an email or
16:09
whatnot so what i'm going to do here is i'm just going to add these these classes manually into the form
16:15
just to test here for the live stream okay um so let's go ahead and preview that
16:24
um actually let's go ahead what i can do is i'm actually going to open up the simulator um just so it's easy for us to see and
16:31
check out here and let's just hide that and we don't need that for right now
16:37
let's just whoops resize my window oh yeah boom okay
16:45
so now we have uh we'll have some live preview over here so in my form what i can do is i'm going to add the processing
16:51
class to the form processing again this is not anything that you're
16:57
going to um need to do this is just me
17:03
i'm manually adding in the class that will happen automatically via javascript when you submit the form so we see here
17:10
the form is in its processing state it's actually not processing right now but we're just
17:16
injecting the processing styles by adding that class so as you see actually this one even
17:22
shows um the little processing indicator and then we see our button that says submitting
17:28
pretty cool right okay so um that's how we can test our processing state um the next is uh success so if we just
17:35
put in success in our form we'll see voila this is what our form looks like when
17:41
it's success right it's kind of cool we can kind of test what our forms will look like when um
17:47
you know they're successful or error processing and stuff like that right so pretty slick um
17:53
so here we go the button says thank you and then we have a nice little you know success message um which is
17:59
using the success stack okay and lastly let's go ahead and um delete the success class from there and
18:06
let's put in error on our form and you see when we have error on our form
18:12
the button says oh no and then we can actually see our error so this is a kind of a
18:17
cool way we kind of learned two things here right it's it's kind of a cool way to test out states and forms
18:23
and you know um i'm also teaching you about the pseudo content thing where we can actually adjust the content within a button now
18:30
you can do all kinds of other things right if you want to add you know um change the styles of the
18:35
form fields or whatever when a success or if you want to change it when it's processing you can do all that with swatches too
18:41
right um just use this parent class to be processing success or error
18:46
and again if you hover over the parent class you'll see all kinds of you know optional you know classes that you can
18:53
use that are kind of automatically added by foundation in various cases okay and the forms ones are our process
19:00
seem success and error cool
19:07
okay um so that's pretty much all with that i thought that was kind of fun um it was cool and i hope you enjoyed
19:13
that uh that was that was that was a fun one with forms i didn't see any great ques any questions so hope
19:19
you guys enjoyed that okay next up um
19:26
i guess we'll leave leave this little live preview up why not let's continue using that um i'm going to go ahead and
19:33
i'm going to delete this form okay and um let's go ahead and add
19:40
a multi-step form okay so what is a multi-step form okay
19:47
you know a lot of times we'll have a really large complex forms and you've probably seen
19:53
this in um many websites where you know you fill out a couple things then
19:58
and then you click next and then you fill out some more fields and then you click next and then you fill out whatever and
20:04
then the last one is submit right so that's pretty cool right um this works works really well
20:10
um and hold on one second i don't have any form actions here cool
20:17
so how do we do this right now this particular one
20:22
if you've looked at this template you know how it does it okay all it does is use tabs okay
20:29
and so i create a tab container this is um you know in tabs now what i did here is
20:34
i'm actually hiding the tabs so i'm gonna go ahead and unhide the tabs for right now
20:40
and voila so here we have step one step two step three so i have my form and in forms you can
20:48
use whatever stacks you want so in this case i'm actually i have tabs in my form
20:56
and then i'm just organizing my fields inside different tabs okay now i didn't want to display the
21:05
actual tab bar at the top to have step one step two step three because i don't want my users
21:11
to necessarily know that it's tabs i just want to use that style of interface does that make
21:16
sense so hopefully that makes sense and um
21:21
so just to show you here um that's what tabs do okay but i don't want to display those
21:28
and in order for to use tabs we actually have to have a tab container as well as we have to have the
21:34
tab stack and the tabs content stack so you have to have both in order for tabs to work
21:39
but i don't want to display the actual tabs so all i do here is i'm going to add the hide class hide h-i-d-e
21:48
and that is a utility class just to permanently hide something i don't want to see it hide it's on the
21:53
page but we're never going to see it okay um so yeah so that's
21:59
how we can hide our tabs and then um i'm not going to go through
22:05
the whole tab setup um there's there is actually a really good video on tabs that shows you how to set
22:10
all that up you essentially just add your tabs and then you have to link like this is step one and then in tabs
22:16
content that's named step one as well and so on and so forth okay
22:22
now what i've done here is you'll notice here that um i have a progress bar indicator okay and we click next and then i have
22:30
the progress bar goes to from 33 to 66 how did i do that how does it know um
22:36
and then there it's it's done it's a hundred percent well it i mean to the average user it might
22:43
think that that's some sort of really smart cool thing that's all dynamic
22:48
but if we look here i just added here's my content for tab one okay and then um i have my a header and
22:56
then our two text fields then i have a progress bar indicator that's set to 33
23:03
there's no logic it's just i know when you're on tab one since there's only three tabs
23:09
we're 33 there right um and guess what when we go to tab two i know we're two
23:16
out of three so i know that we're 66 percent there so guess what i just have another progress bar indicator that's set to 66 there's no
23:24
fancy calculation that says i'm magically a tab two i'm going to dynamically calculate things and
23:31
you know no it's just i know you're i know i created a three-step tab i know tab
23:37
two is 66 so i just added a 66 status bar in there or progress bar in
23:44
there right smoking mirrors right a lot of the web is smoking mirrors guys
23:49
okay it's all you know uh you know illusions to make people think that something really really smart and clever
23:55
is happening like like this progress bar is dynamically moving it's not it's just just going it's just two different
24:02
completely two different status bars for progress bars keeps on the status bar okay um and then guess what down on the
24:09
last one the progress bar just it's static and it's set to say thank you and it's set to 100
24:15
there we go okay um next up is the buttons
24:21
so i have uh next and previous buttons okay and the last the on the last slide
24:28
um or on the last tab um i don't have a next button because there is no next so i in in the place of the next button
24:34
there's a submit button but i still have a previous button so people can go back
24:39
okay now on slide one if you if you're wondering here it is there is no how can i put in a previous
24:45
button here okay if there really is no option to go um you know previous so i i set it to
24:53
previous and then i i set it to be disabled okay um and i did that for aesthetic reasons so that
25:00
when you click next it looked good right because um here let's just go ahead and i'm
25:06
going to go ahead and uh do [Music]
25:11
the heck there we go um let's turn off the uh actually no i'm
25:18
gonna hide i'm gonna just add the hide class in that
25:24
and if we go here okay so here i've hidden that previous button on slide one
25:29
right on step one and if i click next it goes from one button to two buttons
25:34
and that just it doesn't it doesn't feel fluid right so um so yeah i decided to add a
25:41
disabled button in there so that it looks uniform right so when you go from step one to
25:47
step two um we still have two buttons and then when we go to step three we still have two buttons right
25:53
um so it just feels more fluid right the the user interface there feels
25:59
better um so next how do we control this like
26:05
how do i how do i create previous and next buttons okay well it's super super easy they're
26:11
just anchor buttons okay um so anchor buttons and all you do is you set the
26:17
anchor id to be the same as um well i need to
26:24
put in my little uh what's that draw app um screen
26:31
screen brush there we go there we go let's do and i think do i still have oh okay i
26:38
still have my little magnifying glass thing man forgot about that trick okay so let's go back to this anchor button
26:44
so if you look here inside here i have the anchor id set to step two okay
26:50
so the anchor id is set to step two so we're linking that to the tab step two
26:57
so if we look at at the tab content this is has a tab content id of step two
27:03
so that's it okay we're we're permanently linking it's not some sort of smart thing that
27:09
says go to the next slide it's linking directly to step two okay so
27:14
um i know on slide one or on step one the next button needs to link to step
27:20
two and guess what when i go to um step two i have two more buttons
27:25
previous and next previous is linked to step one and the anchor button for next
27:33
is linked to step three okay and then um at the at the last
27:40
slide on step three the previous is linked to step two
27:46
and then we have instead of a next button i have a submit button here okay so that will
27:51
then submit the form
27:58
okay so yeah pretty cool i'm and this is again this is just one form um and uh we're tabbing through these
28:06
fields and kind of tricking the user um to you know fill out more fields so that they're not
28:13
overwhelmed with tons of them now granted this particular example isn't a lot of fields right but
28:18
it works okay man should i got a glass of water
28:28
um just think outside the box here um tabs is
28:34
one container that you can use right there's all kinds of ways you can build multi-step forms
28:39
using things right maybe an accordion okay if you want that style of inner you
28:44
can do a similar thing here with accordion you can even do next and previous and then it'll open up the accordions
28:50
exactly the same way as tabs okay actually here let's let's do this um
29:00
can i do
29:06
oh accordion at medium
29:14
oh that's interesting here let's so if i did accordion at medium
29:21
there we go here's an example of accordion right so here i have now with accordion you
29:27
can't hide the titles because that's you know you can't do that accordion has to have um
29:33
and remember tabs here can morph between accordions and tabs i'm not going to
29:38
dive into that but essentially i just morphed these tabs this tab interface into
29:43
um an accordion okay so maybe on mobile this is
29:49
something you'd want right but you know here you can go directly either by clicking on these to go to the various things or you can click next
29:56
right so same exact thing okay so accordions
30:02
another idea is to use a slider
30:07
you know you can have um you know content fields on one slide or form fields in one slide
30:14
click next go to the it'll animate in go to the next slide right and then click next and
30:19
go guess what go to the next slide it has all the fields and then in your very last slide in your slider
30:24
have a submit button and that's another idea right so um yeah tons of really cool
30:30
interesting layout ideas for um for this maybe you can use off cam i don't know how off-cameras would
30:36
work maybe off-campus could work that seems maybe a little out there but i'm sure someone could come up with a
30:42
cool example of forms inside multiple off-campus panels it's kind of crazy but anyway
30:49
yeah hopefully this opened your eyes maybe made you think outside the box with forms um there's nothing special here with the
30:55
form itself right it's just how we're laying out the form fields
31:01
okay there's nothing special you need to do with a form in order to get this to work
31:06
um it's just using tabs inside of a form or an accordion inside of a form right slider inside of
31:13
a form all those should work really really well let's just look to see uh
31:18
what what else where the containers are in here that could be interesting um i guess you could use light boxes
31:26
i don't know man clicking next it would open up a different light box i don't know that seems funky i would i
31:32
wouldn't necessarily recommend that um same thing with drop downs
31:37
i can't see having multiple drop downs working um but anyway um
31:44
yeah those i think tabs accordion and slider are probably going to be your best bet for uh
31:49
um the most user-friendly interface for a um and even to be honest recording i
31:55
don't know it's interesting having it stacked sections um you know it is interesting
32:00
but okay so now we're gonna be diving into i'm gonna be going into some advanced stuff so um if you consider yourself a beginner
32:08
um hold on to your pants um because uh we're gonna be doing some
32:13
really cool stuff and i noticed that it's already 12 15 my computer just told me and um there's no way i can do this in
32:20
15 minutes so we're going a little long in this hangout or live stream but i did waste like 15 minutes
32:26
you know fixing stuff so sorry about that okay so let's let's actually use this
32:35
um this form um let me just go ahead and break out this form a little bit um just so i
32:43
i want to make it as clean as possible i don't want this tab interface but we'll we'll keep the same general
32:49
concept okay i'm going to have this form
32:59
we're gonna we're gonna create a um h1
33:09
duplicate duplicate so we've talked about multi-step forms
33:16
and now i'm going to talk about multi-page forms okay um and those are
33:23
it's very different okay so let's do step one
33:30
step two step three okay
33:40
oops all right
33:49
all right and i need a smith button all right so remember in this particular form that we had a multi-step form step one
33:56
had name and email address okay uh let's go ahead and i need a
34:02
submit button though and instead of going through multiple steps on the same page we're going to go to
34:08
multiple steps on different pages okay um so let's go ahead and i'm going
34:13
to add a submit button there okay and we just say submit
34:20
actually here we go we can say next right because uh we'll say next
34:26
okay um i'm gonna build out all the forms on different pages first okay so
34:33
um let's go ahead i don't need this project anymore
34:41
um and then in step two we're gonna go ahead and pardon i'm just gonna have this here
34:48
just so i can use the same exact form stuff here so i'm going to drag this up
34:58
and then we're going to delete all of this except i need that submit button
35:11
submit and this one's going to say next as well okay
35:18
and then let's go to our last step one two three delete those
35:27
let's see just uh there it is delete that and here uh one two and we already have
35:33
our submit button okay let's do that boom
35:40
and we'll take out okay okay so here we have the same thing that
35:48
we had in that tabbed interface but instead we're using three different pages
35:54
okay um so page one collects our name email and then we click next
36:02
and i'll we'll tie all these together in a minute but i just wanna um show you kind of what i did here then
36:08
in step two uh we're pulling in uh i don't remember what this is um what is this called months
36:16
and then favorite day okay so we're picking out months of the year and favorite day
36:22
okay and then we click next and that will submit the form and then we're going to go to step three
36:28
which you can provide some comments all right and then and then this ultimately submits the
36:33
form and at this point we would add our email action or something like that right so here you do an email action
36:40
okay and for fun i'm going to go ahead and let me just configure this really quick
36:53
oops
36:58
okay there we go joe workman oh yeah that's fine
37:04
i'll just get the default template okay good
37:11
okay so now how do we tie these steps okay together um i can actually go ahead
37:20
and let's publish this and let's get it to a decent url here so
37:27
um i'm gonna go ahead and do that that'll be the home page and this
37:33
one will be step two step two and then step three will be
37:38
slash step three just so i i know the urls of everything okay uh i'm gonna go ahead and publish
37:46
this to my so we can actually test it do configure manually add from bookmarks
37:54
uh this bad boy remove
37:59
um and publish oh oh i need my website settings
38:06
let me just get i'm going to publish it to my sandbox site
38:13
there we go click publish
38:21
oh 374 files
38:42
all right sweet hold on oh i have multiple index files shoot
38:48
oh it's because all these are index.html i normally use index.php that's fine let's index.html will win anyway which
38:55
is what we want oh i changed my server to defaulted php
39:04
all right hold on once i let's just go ahead and change my index files to be php
39:09
uh change file name here i'll change all of these just in case
39:14
normally i go ahead and change the default since this was a new project file normally i change the default extension
39:22
on all my pages to be php so normally i go into the general settings actually no advanced settings
39:28
any change default extension to be php so that way any new page that you add will be php let's go ahead and publish this
39:40
again i don't create create many new project files and then publish them so
39:47
there we go okay so now um my server goes ahead and uh we have our
39:54
form okay now if i submit this form right let's just use autofill boom click next
40:02
um well i don't have any i don't have any actions right so how do we um how do we configure this
40:08
how do we go to how do we link this form to step two okay so uh we're gonna use something
40:15
called a get url action okay it's a pretty cool thing
40:22
and uh what get url action does is we give it a url
40:28
so we want we need to give it the url of where we want this to go to oh my son's bringing me
40:34
some water
40:42
ah there we go mouth is getting all dry so we are going to give it to the url of
40:48
the webpage we want it to go to okay it has to be a url so uh remember i named that step
40:54
two there we go here's our step two so my news i'm gonna copy this url and
41:00
i'm gonna paste it in there so now when i submit this form
41:06
it's going to navigate to step two and then it's actually gonna send us all the data as well okay
41:13
um so let's go ahead and um i'm gonna copy that let's go to step two
41:20
let's paste that in there
41:26
ah get url action i'll just delete that then
41:31
go in here and paste paste my url and this one's going to be
41:36
step three okay so on step two on on the form that's on step two i'm gonna go ahead
41:42
and get the put in the get url action and then i i put in the url to step three
41:50
okay and then in step three this one actually sends an email action
41:56
okay let's go ahead and publish that
42:07
that's fine okay so let's go back to our homepage
42:14
okay so i'm gonna go ahead and let's fill out this form again and now this time when i click next uh
42:21
hopefully safari didn't cache everything like it normally does let's go ahead and click next and of course it cached it hold on let's
42:28
go ahead and close that open up a new safari window actually i don't need don't need that anymore
42:39
okay go auto fill click next come on
42:56
there it goes i declare my cache a lot of times so here's a a little tip
43:03
okay i know a lot of us get frustrated especially with safari seems to be so aggressive with caching okay if you
43:11
open up the dev inspector while the page is loaded okay um and then if you go to the
43:18
network tab okay so network tab and then you'll notice this little doohickey
43:25
right here okay that essentially disables caching
43:31
okay so um if you click on that um that should and i say should
43:37
i there are sometimes some things still get cached but most of the time um you know 95 percent
43:43
of the time um you know just by refreshing the page with the dev inspector open and this
43:49
little do in this little button clicked um everything will be downloaded and nothing will be loaded from cache
43:56
so there you go there's a little tip and trick for you i know we all deal with caching um that is the the next level caching
44:04
thing with safari okay um we are now on step two when i clicked remember uh we i
44:12
here let's go back just to show you that again i was on the fee i was on this field filled out my form
44:18
click next and it took me to step two okay now what's important is i'm going
44:24
to go ahead and make this window bigger because we're going to look at the url okay and let's let's look at this url
44:30
bar you'll see that it went to step two and then what if you notice here it passed information
44:38
to the url so it has name equals joe workman and then my email address
44:45
pretty cool now if you also notice um what it did is the name equals that has to do with the
44:52
form field name okay so if we go back into rapidweaver
44:58
okay uh let's go back to step one we'll see that this particular form it has a
45:04
field the first field name is called name so hence that's why in the url it said name
45:10
equals and then whatever i typed into that value okay and then if we go to the email form
45:15
guess what that says email okay so it takes um this data from the form
45:22
and passes that data to step two okay and at that point we can go ahead
45:28
and select our um you know march 24th
45:34
okay my wedding anniversary and then we click next again
45:39
now let's go ahead and look at this url if we look here we have months labels
45:47
march months equals 03 and number name equals 24.
45:55
wait but what happened to name and email address hmm interesting
46:00
interesting darling okay so uh but let's let's continue on let's just continue on we we got to our
46:07
step three um i'm going to go ahead and um uh live
46:12
stream hello we're gonna click submit okay and now i should have gotten an
46:20
email let's go ahead and open up my mail.app
46:25
somewhere over there okay
46:32
and here's my email now if we see the email only contains
46:39
comments like where's all that uh where's step one and step two where is that data
46:45
okay now i knew this was gonna happen and i kind of did this on purpose to teach you um you know how the things happen
46:53
okay so
46:58
when i go back let's go back to step one when i was in step one okay
47:05
and i filled in my my data and i clicked next okay
47:11
um the url passes the data to the web page okay but currently our form here in step
47:19
two doesn't take that into effect at all okay it doesn't
47:24
capture that data from the other from step one so how do we capture that data from step one
47:30
okay super super easy okay so remember in step one we had uh inputs
47:37
for name and email okay
47:42
so uh what we're gonna do is um we're gonna we're gonna add name and email to this
47:48
form as well actually let me back up a little bit
47:54
more um foundation has a foundation forms
47:59
have a feature that allow you to um pre-populate form data
48:04
via just by passing data to the urls okay for example here on this form
48:11
uh we have the name and email form fields okay if i go ahead and pass a question
48:18
mark name equals um joe workman enter
48:26
what we'll see is i passed data via the url and i told it to i i
48:34
said name equals joe workman foundation forms look at urls and say hey he passed a name
48:40
parameter to the url i i as a form also have a form field
48:46
called name well guess what i'm going to take that data from the from the url and i'm going to inject it in my form
48:53
field name or in my form field so here we have boom we have our name is
48:59
now set to joe workman pretty cool okay and if we wanted to do email as
49:06
well i can do and ampersand and then email equals with an email address
49:12
okay so there we go so now i have now i pre-populated this
49:19
form with data just by passing data to the url okay
49:27
so now let's take that concept that feature and let's use it in this multi-page
49:33
multi-step form okay because when i click next
49:40
guess what that's exactly what this does it takes the name and the email and it passes it to
49:47
this form so how can i integrate i don't want to display those form fields but i
49:53
want to capture that data i want to capture the name and email address that i s that i
49:58
have in this form but since i don't want to display it what can we do
50:04
well essentially forms also has hidden data so what i can do here is i'm
50:12
going to go ahead and add hidden data to my form and guess what i'm going to name hidden i'm going to
50:18
name this hidden data name and the value could be we'll just set the default value to be blank
50:27
and then i'm going to create another one and i'm going to name that field email so
50:34
i have these hidden data fields
50:39
that are called name and email now when foundation form sees that i
50:45
pass those parameters via the url it's going to inject that data into those hidden fields even though the
50:52
user doesn't see it it is there
50:57
okay so let's go ahead and um let's do the same thing for step three
51:02
now in step three oh actually let's go ahead and publish this now let's publish that
51:14
yeah i know i have multiple files it's fine refresh
51:19
all right uh or well just for
51:25
all right so now we're on oops step i want step one
51:33
and we're gonna auto fill this we're going to click next okay now it passed all those parameters
51:40
via the url i don't see the data there
51:45
okay um but it is there okay let's go ahead and select march
51:52
24th and then we click next again now when we click next here we'll notice
51:59
if we look at the url now you'll see that in step three the url has look it has
52:08
man hit the wrong keyboard combination here oh there it is um so there we have name
52:15
equals joe workman email equals my email address months equals march um
52:24
month equal 03 and number name equals 24. pretty cool right okay
52:31
so what can we do i so now i need to capture this data inside step three okay
52:39
and we're gonna do the same exact thing actually i'm gonna um you know this this particular select box just to make
52:44
things a little less complex here i am going to change this from a multi-select
52:50
to a select box just for kicks
52:58
boom and um we're going to call it we're going to
53:05
call it month month all right
53:11
all right because i just want to select one month and a day okay
53:17
and then um okay so now in step three um we need to collect all the data from
53:23
step one and step two so um here i'm gonna go ahead and get this hidden data i'm gonna copy that
53:31
and then we are going to uh paste it so here i have name and email okay but i need to go here and
53:38
i need to capture this um so let's just instead of number name let's do this day
53:44
so now we have uh month and day fields okay so let's go ahead and step
53:50
three i'm going to uh hidden data we're going to change this to be month and then
53:58
we're going to change this one to be day again we're passing all this data to
54:03
this form the form is going to if it exists in the url it will populate these hidden data
54:09
fields with that data let's publish that
54:19
let's start all over
54:24
okay so now we're going to start all over i'm going to go ahead and autofill click next
54:32
now i have my uh my month here i'm going to click march and i'm going to click i'm going to
54:38
click next okay and just to verify let's go ahead and look at this url i've
54:45
my name is joe workman email is there right uh let's keep going
54:51
um the month is march the month i id is oops ah sometimes my gestures
55:00
get me uh month is 03 day is 24. okay so all the data is
55:06
passed via the url it should be there in the hidden data um and let's just let's test it
55:12
please work and then we say submit
55:19
the form is now submitted and if we look
55:24
voila i have all of the data from all the steps so i have my name my email my month my
55:30
day and the comments
55:37
pretty cool right so this allows us to take a form integrated across multiple
55:45
pages um and then you know do some pretty slick stuff
55:56
now because i mean there now if you're an advanced user and you already know that there are other tools out there
56:02
that that give us the ability to process um url fields right so for example agent
56:09
if if you wanted to customize your form based on a user's response from a previous step you can maybe um
56:17
take agent analyze the shoot man the heck
56:22
that gesture app is a little annoying sometimes okay um you can like maybe if if the month is
56:30
you know january or february display something different on this page you know i don't know but
56:36
you can essentially analyze the urls with agent and then either customize the form fields you can
56:43
add different form fields you can do all kinds of crazy stuff right um you know with this so i'm just
56:50
thinking outside the box and on how you can take this even to the next level i'm not gonna do that right now but you
56:55
can definitely use agent man this uh does not like me today this gesture
57:01
um so anyway so yeah pretty cool stuff now there is a limitation with this
57:09
okay you are if you have a really really really
57:14
really big form there could be lots of data in your form
57:20
okay and you could run into issues
57:26
with the url actually being too long there is a limit i think the limit is like
57:31
2 000 characters or something right i'm in a url all right let's uh
57:37
hold on let's let's look
57:46
what is the maximum url in different browsers
57:52
32 kilo 32 kilobytes jesus christ interior explorers 2000 safari 80 000 oh
57:59
that's pretty big okay who use it i don't care about internet explorer anymore let's see firefox is 65 000 well it's a lot bigger
58:06
than i expected it to be okay and chroma's big that's 32 kilobyte carry that's a lot of characters um
58:14
okay so 65 000 characters wow so if you ever looks like that's the smallest one i
58:20
forget about internet explorer okay so that's actually pretty big so you you
58:25
can use this um technique for if there's up to 65
58:31
000 characters in your url okay um that's a lot right but
58:38
another thing is what if what if you wanted to maybe protect some of this data you didn't want some of this data to be displayed in the
58:45
url bar for some reason okay um it is possible and that that takes us to
58:52
the next level here so level three we're now at level three defcon three okay and to do that i need
59:00
to do some more edumacation so we've been using this thing called
59:06
get url action what is a get why why does it have the word get there
59:12
okay if you look here you'll notice that there is both a get url action and a post url
59:20
action what is that okay so
59:27
there are different types of let's back up the web all configures um
59:34
or all communicates over a protocol called http okay or https a lot of times right
59:42
the secure version and let's see do
59:49
yes okay and a lot of these requests majority of the web runs on on something
59:58
called a get request so over the http protocol there are
1:00:03
different types of requests the most popular of those is a get
1:00:10
in a post a get request is probably
1:00:16
99 of the web okay it essentially um sends a url
1:00:23
to with a server saying get me this data
1:00:29
okay it could be a in this case it's a this particular url right in uh in this web page case
1:00:37
it's this url plus all of these parameters and based on those parameters that are
1:00:42
passed to the url the web server can give you different information but it's
1:00:48
essentially just a request for data get me this data
1:00:55
okay it is a query now post is something different
1:01:02
post says give me data but then you can actually supply
1:01:08
information okay that is hidden from the that is
1:01:15
separate from the url so you can actually supply data outside of the url
1:01:22
and most of the time post requests are done for telling the server to generate some sort of action however
1:01:29
browsers can display post requests as well but the data that is associated with
1:01:35
that request is hidden from the url okay so let's see the difference let's
1:01:42
convert this form instead of using get requests we're gonna use post requests okay so i'm gonna go ahead i'm
1:01:50
gonna copy this url we are going to delete this get request and i'm going to add a post url action
1:01:58
i'm going to go ahead and and i'm going to go ahead and put in that url same exact thing it's
1:02:04
just a post instead of a get and then we're gonna do the same exact thing on step two
1:02:12
we're gonna do a post we're gonna paste in that url make it step three okay so now i have a
1:02:19
post url on step three and i have a post url on step two
1:02:25
now there's something we need to do because uh when um this hidden data
1:02:33
uh that whole remember how i told you if you pass data to foundation forms okay um
1:02:41
foundation will look at the url okay and then populate the form data based on
1:02:46
data in the url all right now in this case we're not passing data
1:02:52
view the via the url it's getting sent with this post request
1:02:57
so what we need to do is i added a feature in the in the hidden data fields where you can instead of defining a
1:03:02
custom value you can say define the value from a post request data
1:03:10
okay and um most of the time you're going to want it to be the same the name field okay
1:03:17
so on this one i'm going to say post request data and then the field name this one is going to be email
1:03:26
okay so here i have the field name of this hidden field is called email
1:03:31
and i want it to default its data from the post data and get the email value from that
1:03:40
okay and then we're gonna have to go to step three and do the same thing here so i'm gonna set this one to be post request data field name is name
1:03:47
this one is post request data field name is email
1:03:53
uh this one we're gonna be post request data field name is month and this one is post request
1:03:59
data and field name is day
1:04:07
okay now i'm going to publish this
1:04:23
all right and let's start from the beginning again
1:04:30
okay so here we go i am going to uh let's just use my autofill again
1:04:35
because it's convenient i'm going to go ahead and click next okay now if we look here this url
1:04:44
the url does not have any of that data it doesn't have my name it doesn't have my email
1:04:49
okay but let's go ahead and continue on i'm going to go ahead and select march
1:04:55
24th click next if we look at the url again
1:05:01
it doesn't have any of that data okay i'm on step 3 though um and um
1:05:12
i'm gonna say please post work i'm gonna hit submit
1:05:18
and waiting for my email voila
1:05:23
and there is my email with all of the data
1:05:30
okay so this is definitely next level stuff okay because um it's kind of invisible
1:05:37
right but we're still passing that data post requests um don't have a limit um well
1:05:44
your server has a limit but it's mostly like in megabytes in size okay um so you should be golden with any
1:05:50
sort of text okay uh input so this is pretty cool right i mean this is uh um definitely
1:05:58
next level form stuff how we can pass data around forms across different pages link these forms
1:06:04
together um it's pretty interesting and uh yeah i hope you guys enjoy that let me see if
1:06:10
there's any uh any questions here
1:06:15
uh okay i like being specific in my urls so i can use the whole 32 kilobytes to
1:06:20
describe what's on the page uh scott says glad i don't have to do
1:06:27
this by hand yep see scott if you started joining the hangouts again you would have known about this two months ago
1:06:35
uh and brett uh yes you can use all 32 kilobytes in in the url if you're using chrome
1:06:42
else is 65 000 characters in firefox so yeah you're limited to sixty five
1:06:48
thousand if you want cross browser capabilities sorry damn i know sixty five thousand
1:06:53
dollars um sweet guys um that's all i had for today pretty
1:07:00
cool exciting stuff um thanks for coming on hope you enjoyed this had a lot of fun
1:07:08
um yeah it was kind of a break i know i've been trying to do some you know beginner level stuff recently and this
1:07:13
is definitely far from that but hopefully i i try to give some explanations on
1:07:19
why and how and what all this stuff happens right i mean the configuration of of
1:07:25
what i did isn't hard right it's just a couple little check boxes and whatnot and you know doing post requests and
1:07:31
creating those hidden data fields it's i don't think the work itself is difficult
1:07:37
but knowing that you can do it um and you know i think it's important to
1:07:42
understand what's going on behind the scenes right and hopefully my explanations of
1:07:47
that were okay i know the the difference between a get and post request could be um definitely a little a little
1:07:54
different for first a non-programmer right but hopefully that that kind of um is
1:07:59
understood oh one other thing i i know i get this question a lot uh let me share my screen again really
1:08:05
quick is um inside the email action or inside
1:08:12
the the form actions um you'll notice that there is a a post url action
1:08:17
and a post url background ajax what is the difference there okay
1:08:24
so the post url action okay that will actually um
1:08:32
like refresh your it's kind of like get where it'll actually go to a url in the browser and it'll also send
1:08:38
the data okay the post url background ajax
1:08:44
that does not leave you stay on the same page and a post url action is happens in the
1:08:51
background okay a lot of that is going to be used if you're um using your own sort of like if you're
1:08:58
communicating with some sort of api or zapier or something like that nature
1:09:03
right the user you're going to stay on the current web page you're on um the form will be submitted that post
1:09:10
url actually will happen in the background and then if it's successful or not that'll that'll you know
1:09:16
reflect that in the form okay but um yeah so that's the difference between post url and post url background
1:09:23
the background just happens in the background the the url in the browser doesn't change at all okay so that's the main
1:09:30
difference on that the background one is going to be used if you're using your own custom like api um because
1:09:36
most apis are all happen via um at least for forms or all happening via
1:09:42
post requests there's other things there's put requests and and delete requests and other stuff but
1:09:48
uh yeah where post is most of the time what's going to happen um on those so you can't do the others
1:09:54
with the foundation form um sorry um so yeah that's a big one so i'm glad i remember
1:10:01
that because i know i get that question a lot when i start talking about post url actions so cool guys this is a lot of fun
1:10:08
um i thought this was cool i hope you enjoyed it hope you learned a little bit and um i will not be on the front on the
1:10:14
hangout this friday um but i know a lot of you guys are going to be there um so
1:10:19
you know join everyone and i'm going to be on vacation for um the next 12 days starting tomorrow
1:10:26
afternoon i'll be around a little bit tomorrow but not much um and then yeah i'll be gone for 12 days
1:10:32
so um hope you guys uh are okay with that uh while i'm gone i'm sure you post in
1:10:38
the community everyone will be there happy join the hangouts um i definitely won't be on next week's hangout
1:10:44
um but uh like i said hangouts happen with or without me there's still a lot
1:10:49
of fun and actually you know sometimes i hear the reports of what happens during those hangouts when i'm not there and i'm like oh damn that
1:10:55
sounds cool i wish i was there right so um lots of stuff in these stuff happens and um so
1:11:02
um yep and if you so if you're wondering where i am for the next two weeks and i don't respond to any
1:11:08
emails or posts on the community i'm i'm not around so i'm gonna be lounging on the beach
1:11:13
um and uh i look forward to that so thank you very much guys i appreciate you um and hopefully uh you guys enjoyed
1:11:21
today take care take care talk to you later bye