Submit button in toolbar?

28 views
Skip to first unread message

sblair

unread,
Jun 4, 2012, 10:01:21 PM6/4/12
to iPhoneWebDev
I basically need to add a submit button to the toolbar.

Ideally I'd like to be able to set which pages it goes on without too
much trouble but even getting it to function at all right now would
help.

The button shows up right now but it doesn't work. Here's my toolbar
code below. The commented out button is the normal submit button I
had at the bottom of the form which did work.

I'm guessing my issue is because the toolbar button isn't in the
within the <form> </form> tags. Any suggestions?

<div class="toolbar">
<h1 id="pageTitle"></h1>
<a id="backButton" class="button" href="#"></a>
<a class="button blueButton" type="submit"
onclick="(function(event) {return true;})()">Send</a>
<!-- <a class="whiteButton" type="submit"
onclick="(function(event) {return true;})()">Send</a> -->
</div>

Giacomo Balli

unread,
Jun 5, 2012, 2:03:45 AM6/5/12
to iPhoneWebDev
how are you linking the action to the "real" button?

Remi Grumeau 

unread,
Jun 5, 2012, 4:33:05 AM6/5/12
to iphone...@googlegroups.com
You're right.... and wrong :)
Between <form> & </form>, an <input type="submit"> does submit the form it belongs to. An input, not a <a>.

Here, submit is in toolbar div, so outside the form. so you need to call the form externally. To do so, you need to give your form a name attribute, and the button needs to target it properly.

using beforetransition / aftertransition listener, you can deal with the show/hide of buttons in the toolbar (or using tbdmod plugin).

Then, if you only have a few forms or a defined list of form, you can set your submit button href to:
javascript:myFormName.submit()
with the form being <form name="myFormName" method= ....> ... </form>

If it's all dynamic, you can use iui.getSelectedPage().name to get "myFormName" value dynamiquely.


Remi
> --
> You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
> To post to this group, send email to iphone...@googlegroups.com.
> To unsubscribe from this group, send email to iphonewebdev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
>
Reply all
Reply to author
Forward
0 new messages