FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Contact Form
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Contact Form [message #175477 is a reply to message #175474] Sat, 01 October 2011 13:55 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Simple array code seems to break ..
Next Topic: Setting variable to false in a WHILE loop
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 13:56:12 GMT 2024

Total time taken to generate the page: 0.04973 seconds