How to prevent iUI from subbing form with Ajax?

2 views
Skip to first unread message

ltlfrari

unread,
Dec 17, 2009, 10:19:09 AM12/17/09
to iui-developers
The real issue is that I don't want a back button to appear when I
submit a form so I want to prevent iUI from subbing it using Ajax and
just let the page form sub as normal.

I couldn't find any way to do this and ended up making the mode
described about half way down this page
http://cookingandcoding.wordpress.com/2008/09/05/iphone-web-applications-with-iui-and-ruby-on-rails-part-1/
to the submitForm function

function submitForm(form)
{
if (form.getAttribute("redirect") == "true")
form.submit();
else
iui.showPageByHref(form.action || "POST", encodeForm(form),
form.method);
}


And coding redirect="true" on my form tag in the web page.

I've made the same change to the 0.40 dev1 ver of iUI as well but is
there any way make iUI NOT use ajax for a form rather than me having
to modify it?

Sean Gilligan

unread,
Dec 17, 2009, 1:10:14 PM12/17/09
to iui-dev...@googlegroups.com

> I've made the same change to the 0.40 dev1 ver of iUI as well but is
> there any way make iUI NOT use ajax for a form rather than me having
> to modify it?
>


Yes. Set target="_self". See this page for examples:
http://iui-js.appspot.com/test/form-test.html

BTW, this sort of question is normally better asked on the iPhoneWebDev
group than on this group (which is to discuss the ongoing development of
iUI itself)

-- Sean

ltlfrari

unread,
Dec 17, 2009, 2:03:29 PM12/17/09
to iui-developers
I didn't know about the iPhoneWebDev group, I shall add it to my
list.

Thanks

Dave E

Sean Gilligan

unread,
Dec 17, 2009, 2:18:08 PM12/17/09
to iui-dev...@googlegroups.com
ltlfrari wrote:
> I didn't know about the iPhoneWebDev group, I shall add it to my
> list.
>

No problem. It happens often.

iUI was "born" in iPhoneWebDev and there are 20x as many members. It is
the "official" place to ask iUI support questions and the best place to
get a response. It also a great place to ask general questions about
iPhone, WebKit, and mobile HTML5 questions.

Both groups are listed on the iUI home page: http://code.google.com/p/iui/

Cheers,

Sean

Reply all
Reply to author
Forward
0 new messages