Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3250

Re: Contact Form

Message-ID <2543482.xMOkQjfE2b@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2011-10-01 15:55 +0200
Subject Re: Contact Form
Newsgroups comp.lang.php
References <pl7d875h4ldsrvh0m9cj4i54kph16r8d35@4ax.com>
Followup-To comp.lang.php

Followups directed to: comp.lang.php

Show all headers | View raw


John wrote:
^^^^
John who?

> I have this code in my contact form and it doesn't post the
> information when it sends me the email.

Wrong.  It posts the information you want it to post: a zero-length string.

> <label for="select-choice"></label>
> <select id="selected" name="selected" class="select" value="test">

The `label' element's `for' attribute value and the `select' element's `id' 
attribute value do not match; as a result, your `select' element will not be 
triggered when the `label' element receives focus.

"selected" is a poorly chosen name for a `select' element.  The name should 
indicate the purpose.

A `select' element does not have a `value' attribute; another reason why 
your markup is invalid.  [The corresponding element *object* has a `value' 
*property*, but that is a different thing.]

<http://validator.w3.org/>

> <option value="">General</option>
> <option value="">Service/Support</option>
> <option value="">Estimate/Quote</option>
> </select>

BAD – Broken As Designed.  Having a `value' attribute value of "" (zero-
length string) is different from specifying no `value' attribute at all. 
Consider this:

  <select id="selected" name="selected" class="select" value="test">
    <option value="">Please select</option>
    <option value="1">General</option>
    <option value="2">Service/Support</option>
    <option value="3">Estimate/Quote</option>
  </select>

For interoperability, you should always specify a `value' attribute for 
`option' elements.  And as my example indicates, you probably do not want to 
post the option *texts* as they will be subject to translation or may be 
subject to renaming while your business logic should not.

> Can anyone tell me the Post code for a drop down menu please?

JFTR: The relevance of this to PHP is very close to zero.  It is an *HTML* 
question, to be asked in comp.infosystems.www.authoring.html.  And you would 
be well-advised to get the basics (HTML, CSS, etc.) right before you try 
developing Web applications with PHP.


PointedEars
-- 
var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Contact Form John  <stepri@sbcglobal.net> - 2011-09-30 22:05 -0700
  Re: Contact Form Stan Weiss <srweiss@erols.com> - 2011-10-01 01:20 -0400
    Re: Contact Form John  <stepri@sbcglobal.net> - 2011-09-30 23:15 -0700
  Re: Contact Form Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-01 15:55 +0200

csiph-web