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
Switch to threaded view of this topic Create a new topic Submit Reply
Contact Form [message #175474] Sat, 01 October 2011 05:05 Go to next message
John is currently offline  John
Messages: 18
Registered: September 2010
Karma: 0
Junior Member
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?
Re: Contact Form [message #175475 is a reply to message #175474] Sat, 01 October 2011 05:20 Go to previous messageGo to next message
Stan Weiss is currently offline  Stan Weiss
Messages: 3
Registered: October 2011
Karma: 0
Junior Member
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
Re: Contact Form [message #175476 is a reply to message #175475] Sat, 01 October 2011 06:15 Go to previous messageGo to next message
John is currently offline  John
Messages: 18
Registered: September 2010
Karma: 0
Junior Member
>
> 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.
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: 0
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
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Mon Nov 25 22:21:29 GMT 2024

Total time taken to generate the page: 0.02591 seconds