Aleks
asked on
Use ASP code A if ipad is being used, else display code B
I have an ASP/VB page and I have a form in that page, the form contains an html editor which works fine in computers but for some reason is very erratic when using ipad.
We want to display the code (A) with the form object HTML editor if user is NOT using an ipad, and display code (B) with the form element being a simple text field is user IS using an ipad, something like:
<% if ipad being used %>
Code for HTML editor here
<%end%>
<% if ipad NOT being used %>
Code for text field here
<%end%>
I don't know how to detect what the user is using to browse and then how to do the IF statements to display one or the other object.
Hope that makes sense.
We want to display the code (A) with the form object HTML editor if user is NOT using an ipad, and display code (B) with the form element being a simple text field is user IS using an ipad, something like:
<% if ipad being used %>
Code for HTML editor here
<%end%>
<% if ipad NOT being used %>
Code for text field here
<%end%>
I don't know how to detect what the user is using to browse and then how to do the IF statements to display one or the other object.
Hope that makes sense.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok, I will try the above and let you know if that works.
I wonder though, how you code the rest of your application/site, if you need someone else to write out the complete If statement that does a string compare?
ASKER
Thanks guys !
ASKER
btw .. if the page is ASP/Javascript what changes in the code that worked ?
---
Function isIPad()
If InStr(Request.ServerVariab les("HTTP_ USER_AGENT "), "iPad") > 0 Then
isIPad = True
Else
isIPad = False
End If
End Function
<%If isIPad() then%>
Code for text field here
<%Else%>
Code for HTML editor here
<%End If%>
----
---
Function isIPad()
If InStr(Request.ServerVariab
isIPad = True
Else
isIPad = False
End If
End Function
<%If isIPad() then%>
Code for text field here
<%Else%>
Code for HTML editor here
<%End If%>
----
ASKER