<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Carl,<br>
<br>
Sorry, i didn't the code to hand at the time, but here it is now:<br>
<br>
<tt>my $form = new HTML::FormFu({id =&gt; 'sell', method =&gt; 'post',
action =&gt; ''});<br>
&nbsp;&nbsp;&nbsp; <br>
$form-&gt;element({<br>
&nbsp;&nbsp;&nbsp; type&nbsp; =&gt; 'Submit',<br>
&nbsp;&nbsp;&nbsp; name&nbsp; =&gt; 'submit',<br>
&nbsp;&nbsp;&nbsp; value =&gt; 'Submit',<br>
});<br>
</tt><br>
The (X)HTML output is:<br>
<pre id="line94">&lt;<span class="start-tag">form</span><span
 class="attribute-name"> action</span>=<span class="attribute-value">"" </span><span
 class="attribute-name">id</span>=<span class="attribute-value">"sell" </span><span
 class="attribute-name">method</span>=<span class="attribute-value">"post"</span>&gt;
    &lt;<span class="start-tag">div</span><span class="attribute-name"> class</span>=<span
 class="attribute-value">"submit"</span>&gt;
        &lt;<span class="start-tag">input</span><span
 class="attribute-name"> name</span>=<span class="attribute-value">"submit" </span><span
 class="attribute-name">type</span>=<span class="attribute-value">"submit" </span><span
 class="attribute-name">value</span>=<span class="attribute-value">"Submit" </span><span
 class="error"><span class="attribute-name">/</span></span>&gt;
    &lt;/<span class="end-tag">div</span>&gt;
&lt;/<span class="end-tag">form</span>&gt;
</pre>
A new field element would be a good idea, like you say, but can't call
it Button. I think i'll use Block to fake a &lt;button&gt; tag, as i
don't need the value - it's just going to be used as a submit button.<br>
<br>
Cheers,<br>
<br>
Ben<br>
<br>
<br>
Carl Franks wrote:
<blockquote
 cite="mid:4f352aae0811270445q6d9a9c97h30f8fb74f12547c8@mail.gmail.com"
 type="cite">
  <pre wrap="">2008/11/27 Ben Vinnerd <a class="moz-txt-link-rfc2396E" href="mailto:ben-formfu@vinnerd.com">&lt;ben-formfu@vinnerd.com&gt;</a>:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi,

I used Element::Button({type =&gt; 'submit'}) in the hope that it would return
a &lt;button&gt;, but instead i got &lt;input type="submit"&gt;

Is this the correct behaviour?

Is the only way to get a &lt;button&gt; to workaround by using Element::Block
instead?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
xhtml defines 2 types of buttons:
    &lt;input type="button" /&gt;
and
    &lt;button&gt;&lt;/button&gt;

The FormFu element creates the first of those.
You could use a Block to fake the 2nd, but FormFu won't receive any
value for it, as a Block isn't a field, as far as FormFu is concerned.
So it will only work if:
* it's being used as a submit button
* there's at least 1 other field/value so FormFu can tell the form's
been submitted
* you don't need the button's value

A proper solution would be to create a new field element, which also
has the Block's content() methods.
Though I'm not sure what it would be called, as Button's already taken.

However, I'm confused by what you're saying with:
    Element::Button({type =&gt; 'submit'})

How are you actually creating the element?
Because if you're creating a Button element...
    $form-&gt;element({ type =&gt; 'Button' });
how can you also be setting "type =&gt; 'submit'" ?

Carl

_______________________________________________
HTML-FormFu mailing list
<a class="moz-txt-link-abbreviated" href="mailto:HTML-FormFu@lists.scsys.co.uk">HTML-FormFu@lists.scsys.co.uk</a>
<a class="moz-txt-link-freetext" href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu</a>
  </pre>
</blockquote>
</body>
</html>