Contact Form

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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>

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

Re: Contact Form

John wrote:
Quoted text here. Click to load it

Did you try?

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


Re: Contact Form

Quoted text here. Click to load it

Thanks Stan this worked.

Re: Contact Form

John wrote:
John who?

Quoted text here. Click to load it

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

Quoted text here. Click to load it

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.]


Quoted text here. Click to load it

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>

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.

Quoted text here. Click to load it

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.

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

Site Timeline