Hi Carl,

Sorry, i didn't the code to hand at the time, but here it is now:

my $form = new HTML::FormFu({id => 'sell', method => 'post', action ="" ''});
   
$form->element({
    type  => 'Submit',
    name  => 'submit',
    value => 'Submit',
});

The (X)HTML output is:
<form action="" id="sell" method="post">
    <div class="submit">
        <input name="submit" type="submit" value="Submit" />
    </div>
</form>
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 <button> tag, as i don't need the value - it's just going to be used as a submit button.

Cheers,

Ben


Carl Franks wrote:
2008/11/27 Ben Vinnerd <[EMAIL PROTECTED]>:
  
Hi,

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

Is this the correct behaviour?

Is the only way to get a <button> to workaround by using Element::Block
instead?
    

xhtml defines 2 types of buttons:
    <input type="button" />
and
    <button></button>

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 => 'submit'})

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

Carl

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
  
_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to