html - jQuery - Change form action based on resolution -
I have a simple form and I have to post the prices on 2 separate pages for a desktop and the other Is mobile
Actually: If the resolution is above 768 pixels, then send the format to the desktop php. If the resolution is low then 768 px, send the form mobile.php
what jQuery Is there any way to do this? Instead of checking the client resolution, think that the best is ckeck if your customer has a mobile device. Because if someone changes the size of a desktop browser under 768px then you may have some problems
with jquery you can use the submit event Are:
$ ('# your_form'). Submit (function () {if (/ Android | WebOS | iPhone | iPad | iPod | Blackberry | IEobile | Opera Mini / i.test (Navigator. User Agent) $ $ (this) .attr ('Action', 'Mobile .fp ');}})
Comments
Post a Comment