also to note, if you are using jquery mobile -- you need to disable ajax for the form -- just ran into that the other day.
i have been using 51Degrees mobi and a very simple script running in app_code to switch the template before the page is served -- negating the need for altTemplate.
Let me know if this is of interest to you -- i could post some more details.
Lastly... the way this is set up... it intercepts the page request and sets the template to be Mobile[originalTemplateName] -- so, you need to create a set of templates for your mobile site that match those template names... hope that makes sense.
Form submit not working when using with altTemplate
Hi,
I've created the contact us form for the desktop version and it is working fine.
Later I've added mobile template for the contact us page and I'm using altTemplate in order to use the mobile template.
After filling the form and hit submit it reloads the page in the desktop version template and form values does not submitted to the server.
I'm not sure what I'm missing here.
Much appreciated your help ASAP as we need to go live at the earliest.
Thanks,
Kishore
Comment author was deleted
And does it submit if you try the mobile template on your desktop machine?
Hi Tim,
No it does not submit. It just reloads the page in desktop template.
Thanks
Kishore
Hi,
I've managed to find out the cause of the issue. Some how the altTemplate parameter is coming as empty string on postback.
After adding the altTemplate on postback resolved the issue.
Thanks Tim for your input.
Regards
Kishore
@Kishore
also to note, if you are using jquery mobile -- you need to disable ajax for the form -- just ran into that the other day.
i have been using 51Degrees mobi and a very simple script running in app_code to switch the template before the page is served -- negating the need for altTemplate.
Let me know if this is of interest to you -- i could post some more details.
Hi Bob,
Please post some more details which will be handy in my case.
Thanks
Kishore
first be sure to have a mobile domain pointed at your site -- i use m.[mysite].com
then download the 51DegreesMobi package here... http://our.umbraco.org/projects/website-utilities/51degreesmobi-foundation
next, you need to edit the 51Degrees.mobi.config which is found in app_data folder
this edit will set the redirect for mobile devices... mine looks like this...
next, you have to add this code to file in your app_code folder -- i call it switchMobile.cs -- you can call it whatever you want.
Lastly... the way this is set up... it intercepts the page request and sets the template to be Mobile[originalTemplateName] -- so, you need to create a set of templates for your mobile site that match those template names... hope that makes sense.
Great stuff bob!
Thanks
Kishore
is working on a reply...