Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition ISBN: 978-0-470-25931-3
This is the forum to discuss the Wrox book Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition by Jon Duckett; ISBN: 9780470259313
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition ISBN: 978-0-470-25931-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 9th, 2009, 06:45 PM
Registered User
 
Join Date: May 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default forms

Im a complete beginner. I have been reading chapter 5 on forms but when i try to validate the code on page 146 i am told that it is in error. I am told that a form element cannot hold input children. The input element has to be enclosed in a p element for example.
Is this true? is the code on page 146 incorrect? or am i doing something unbelievably stupid
 
Old December 6th, 2009, 11:51 AM
Registered User
 
Join Date: Dec 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What you have to remember is that many of the code examples shown are examples on ONLY that part of the code. The author is assuming that you'll understand that the example (below) is nested inside the basic shell that you learned in chapter 1.

Remember that when you see:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<form action="http://www.example.org/search.aspx" methog="get" name="frmSearch">
Search:
<input type="text" name="txtSearch" value="Search for" size="20"
maxlength="64" />
<input type="submit" value="Submit" />
</form>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

what they're saying is this:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title></title>
</head>
<body>
<form action="http://www.example.org/search.aspx" methog="get" name="frmSearch">
Search:
<input type="text" name="txtSearch" value="Search for" size="20"
maxlength="64" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For the examples to show on a web page you need to include - at an absolute minimum - the following tags:
<html>
<head>
<title>
</title>
</head>
<body>
The code from the examples here.
</body>
</html>

Adding those should make the code show up as intended on the web page.

What I did was make a HTML starting template and when I start a new HTML page I start with the template that follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title></title>
</head>
<body>


</body>
</html>

Then I just put the curser between the <title> tags or the <body> tags to start writing.

Hope this helps if you're still around.

Last edited by edwait; December 6th, 2009 at 11:57 AM..




Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms ghall202 Access VBA 5 February 13th, 2007 10:32 AM
Forms and Sub forms Mink Access 1 December 1st, 2004 08:38 AM
Opening forms from other forms Paulsh Access VBA 1 September 30th, 2004 06:54 PM
regarding Forms spraveens Beginning PHP 4 February 16th, 2004 03:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.