Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #3247 > unrolled thread
| Started by | John <stepri@sbcglobal.net> |
|---|---|
| First post | 2011-09-30 22:05 -0700 |
| Last post | 2011-10-01 15:55 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.php
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
| From | John <stepri@sbcglobal.net> |
|---|---|
| Date | 2011-09-30 22:05 -0700 |
| Subject | Contact Form |
| Message-ID | <pl7d875h4ldsrvh0m9cj4i54kph16r8d35@4ax.com> |
I have this code in my contact form and it doesn't post the information when it sends me the email. <label for="select-choice"></label> <select id="selected" name="selected" class="select" value="test"> <option value="">General</option> <option value="">Service/Support</option> <option value="">Estimate/Quote</option> </select> Can anyone tell me the Post code for a drop down menu please?
[toc] | [next] | [standalone]
| From | Stan Weiss <srweiss@erols.com> |
|---|---|
| Date | 2011-10-01 01:20 -0400 |
| Message-ID | <4E86A32F.1AD87016@erols.com> |
| In reply to | #3247 |
John wrote: > > I have this code in my contact form and it doesn't post the > information when it sends me the email. > > <label for="select-choice"></label> > <select id="selected" name="selected" class="select" value="test"> > <option value="">General</option> > <option value="">Service/Support</option> > <option value="">Estimate/Quote</option> > </select> > > Can anyone tell me the Post code for a drop down menu please? Did you try? <option value="General">General</option> <option value="Service/Support">Service/Support</option> <option value="Estimate/Quote">Estimate/Quote</option> Stan
[toc] | [prev] | [next] | [standalone]
| From | John <stepri@sbcglobal.net> |
|---|---|
| Date | 2011-09-30 23:15 -0700 |
| Message-ID | <00cd87t1hf7fvfbt3gk1hpi5qcfpvpjs90@4ax.com> |
| In reply to | #3248 |
> >Did you try? > ><option value="General">General</option> ><option value="Service/Support">Service/Support</option> ><option value="Estimate/Quote">Estimate/Quote</option> > >Stan Thanks Stan this worked.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2011-10-01 15:55 +0200 |
| Message-ID | <2543482.xMOkQjfE2b@PointedEars.de> |
| In reply to | #3247 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web