Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Adding input fields

From: Creating a First Web Site with Dreamweaver CS6

Video: Adding input fields

Now the web is great because it allows me to communicate to the world, to get my message out there, but what if people need to contact me? Well, it is a two-way medium. Yhat's why I have the contact page open, because what I need to do here is go beyond just a link. So this actually will link out to this email address, but it launches the default email client, whatever they have on their machine. But what I want to implement is a form field--in fact, basically the ability to fill out a form and send me a message. Name, email, and the message, as well the Submit button.

Adding input fields

Now the web is great because it allows me to communicate to the world, to get my message out there, but what if people need to contact me? Well, it is a two-way medium. Yhat's why I have the contact page open, because what I need to do here is go beyond just a link. So this actually will link out to this email address, but it launches the default email client, whatever they have on their machine. But what I want to implement is a form field--in fact, basically the ability to fill out a form and send me a message. Name, email, and the message, as well the Submit button.

So I'm going to close Safari, I'm going to go into my contact page, and then I'm going to delete those lines, just like that. And I'm going to go to the Insert panel, and I'm going to change that to Forms, okay. So that's what I have up. And I need to implement a Name field. That's going to be a text field. Well, there is actually a couple in here. And notice right up here near the top there's this Text Field, but as I scroll down I want to use this Spry Validation Text Field because this has additional functionality I could take advantage of.

So with my cursor right there, I can select Spry Validation Text Field, and I can go ahead and give it an ID. And in this case, it's going to be, you guessed it, Name. I'm going to leave everything else as is. Okay, you don't need to worry about any of that. You don't even need to worry about the label because I'm going to show you what you can do with the label. So, selecting OK, this is a message you'll get. It says, hey, do you want to add a form tag? And a form tag is just a tag that will encompass all of the different form fields and allow you to submit all of that information to wherever you want to send it.

So you do want to say yes here. And that form field is actually this red line. But this is my Spry Text Field that I've added. So I can select it. Now, the first thing I'm going to do is change the name of it. It says Spry Text Field over here. I'm going to get rid of that one, and I'm just going to call this--in fact I'm going to name this the nameTextField, okay, just like that. With that selected, I can take a look at all these different options I have because it's a Spry Validation Text Field.

So again, right down here I can add a hint, and this will be your name. As I enter that in, that's actually what will appear right in here. And I can always check that by clicking Live view. So there you can see that's exactly what I want, nice and efficient. I can have a minimum number of characters, a maximum number of characters, if I want to as well, but this is what I like. This Preview states is going to be required information. In fact, on Blur, so when you deselect it, I want it to say, hey you know what, a value is required, because you have to enter in your name if you want to be contacted back.

That's the whole idea, allow them to enter in their name and make it required, and that's what we need to do. I'm going to place my cursor over here and just hit Enter, because for my next field I'm going to add a Spry Validation Text Field. And in this case it's going to be email. That's the ID. I'm going to leave everything else alone. Nice and easy. Selecting that, changing this to emailTextField, like that. And as I select it I can give it a hint, Your Email--not your friend's email but your email.

And required on Blur, this is a required item as well. In this case, in the case of an email, I want to make sure they submit a valid email, so I'm going to change the Type to Email Address, okay. So that's going to recognize whether they have @ symbol and a period. Next up, hitting Return after I put my cursor on the end here, and now I need to implement a text area, okay. So selecting that, the ID is going to be message, selecting OK. Scrolling down, you can see it right here, and I want this to be a messageTextArea.

All right, so selecting that, I can take a look, and I can say hey you know what, minimum number of characters is one, maximum number of characters maybe like 500. Okay, not too many, but about 500. I don't need to get a long book delivered through this emailTextField. Nonetheless what I can do is I can include a counter, which I really like. I can say since I'm requiring a minimum of one but really a maximum of 500, I can say you know, what counts the characters remaining.

So I'll show you what that looks like. As far as validation, I want to validate it on Blur, just like I've been doing. I'd say that looks good. Even the hint might be Your Message. With all of that in place, in fact, I'm going to save this page now, and look what gets added, all these dependent files for text fields, text areas. That's good. Clicking Live view, you can see as I scroll down how this is set up. So I can type in your name, so right there. Well, let's click off to Your Email, so I'm actually going to come mess this up.

I'm going to do the @ sign but I'm not going to put a period, and as I defocus it, or blur it, it says hey you know what, this is an invalid format. So I'll type in the correct one and blur it, which means you know defocus that, and you can see that they're green, green means go. Right in here, I love your site, a couple of exclamation points. As I do that, you can see that character count right down here, change. Hey, why not add a couple extra exclamation points. I can click off of that as well.

This looks good. The last thing I'm going to do is I'm going to go ahead and add a Submit button. So I'm going to turn off Live view and just after that last element of that text area, I'm going to add a button. So right here I'm going to insert a button. ID again is going to be Submit. Select that, type that in. There is my Submit button. I can see, overall, everything looks pretty good. I like how this looks. It's actually going to work pretty well. And really, the next step with this form is to go ahead and actually implement the functionality, when you hit Submit, have it submit the data and even go to a Thank You page.

Show transcript

This video is part of

Image for Creating a First Web Site with Dreamweaver CS6
Creating a First Web Site with Dreamweaver CS6

30 video lessons · 40123 viewers

Paul Trani
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Creating a First Web Site with Dreamweaver CS6.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.