Hi,
I'm trying to get the users IE screen resolution at run-time, so I can decide in fpl on a course of action to take regarding presentation.
Is there an ebase in-built way of detecting the client IE screen resolution? If not, I can determine the screen height & width using javascript by using;
screen.width and screen.height
If there isn't an ebase in-built function for getting the screen height & width (in pixels) is there a way of passing this info into an ebase filed if I call the javascript from the form properties; HTML++ section?
Hope this makes sense. Thanks,
Jez
Client Screen Resolution
Moderators: Jon, Steve, Ian, Dave
- Jez
- Ebase User
- Posts: 31
- Joined: Thu Aug 21, 2008 11:03 am
- Location: Hampshire County Council
- Joost
- Ebase User
- Posts: 49
- Joined: Fri Sep 14, 2007 6:14 pm
- Location: The Netherlands
Re: Client Screen Resolution
Use JavaScript to set the uservar formfields. Trigger form submit with javascript function.Jez wrote:is there a way of passing this info into an Ebase filed if I call the javascript from the form properties
http://portal.ebasetech.com/cp/doc/Pane ... action.htm
0 x
- Jez
- Ebase User
- Posts: 31
- Joined: Thu Aug 21, 2008 11:03 am
- Location: Hampshire County Council
Hi,
Thanks for your reply Joost.
My javascript knowledge is unfortunately fairly poor, but the instructions linked to above seem to be for passing a variable into the ebase $USERVAR1 variable, when a button is clicked on a non-ebase section of a form (e.g. a JSP). Have I understood this correctly?
I need to automatiacaly set the variable when the form loads, rather than when a user clicks a button. I do have a LEFT and a TOP JSP on my form, but if I'm not actioning the set when a button is pressed, do the JSP's need to be involved in this process?
If I put the following java script into the HTML++ section of the ebase form I call, I get an alert pop up showing me my screen width as anticipated;
However, if I try setting the $USERVAR1 field from here (as follows)
I get a javascript error when the page loads;
'documents.RW.elements' is null or not an object
Does anyone have any advice?
Thanks for your reply Joost.
My javascript knowledge is unfortunately fairly poor, but the instructions linked to above seem to be for passing a variable into the ebase $USERVAR1 variable, when a button is clicked on a non-ebase section of a form (e.g. a JSP). Have I understood this correctly?
I need to automatiacaly set the variable when the form loads, rather than when a user clicks a button. I do have a LEFT and a TOP JSP on my form, but if I'm not actioning the set when a button is pressed, do the JSP's need to be involved in this process?
If I put the following java script into the HTML++ section of the ebase form I call, I get an alert pop up showing me my screen width as anticipated;
Code: Select all
<script>
alert(screen.width);
</script>
Code: Select all
<script>
setFieldValueExternal("$USERVAR1","test");
</script>
'documents.RW.elements' is null or not an object
Does anyone have any advice?
0 x
--------------------------------------
Jez Hollinshead - Hampshire CC
Jez Hollinshead - Hampshire CC
- Joost
- Ebase User
- Posts: 49
- Joined: Fri Sep 14, 2007 6:14 pm
- Location: The Netherlands
This is possible with the javascript functions. No user interaction needed.Jez wrote:I need to automatiacaly set the variable when the form loads, rather than when a user clicks a button.
Ah... ok. use bottom.jsp. Following code should do the trick.'documents.RW.elements' is null or not an object
Code: Select all
<script>
setFieldValueExternal("$USERVAR1","test");
externalSubmit();
</script>
0 x
Who is online
Users browsing this forum: No registered users and 129 guests