Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

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.
SOLUTION
Avatar of ingriT
ingriT
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

Thanks, I guess that will answer 1/4 of the question. Ill wait for more feedback to later on assign points.
SOLUTION
Avatar of Luis Pérez
Luis Pérez
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

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?
Avatar of Aleks

ASKER

Thanks  guys !
Avatar of Aleks

ASKER

btw .. if the page is ASP/Javascript what changes in the code that worked ?

---

Function isIPad()
    If InStr(Request.ServerVariables("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%>


----