Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SetFocus to an iFrame on a CRM tab

Posted on 2009-05-20
4
Medium Priority
?
1,102 Views
Last Modified: 2012-06-27
The stunnware site indicates I can switch tabs and set focus to a field by...

// Set focus to the field.
crmForm.all.SOME_FIELD_ID.SetFocus();

In my case the only fields on the Tab are iFrames.

crmForm.all.IFRAME_MyFrame.SetFocus(); generates...
error: 'crmForm.all.IFRAME_MyFrame' is null or not an object.

Help would be appreciated
0
Comment
Question by:Larry Trimble
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Biffster007 earned 375 total points
ID: 24436698
Hi,

Make sure the IFrame name is in the exact case.

Also, ensure the 'Restrict Cross Frame Scripting' check box is unchecked.

Try:

crmForm.all.SOME_FIELD_ID.focus();

Let me know how you get on.

Cheers,
MH
0
 
LVL 11

Assisted Solution

by:rakeshAgarwal
rakeshAgarwal earned 375 total points
ID: 24438580
Other reason might be the iframe is not still loaded when  you try to access the Iframe.  So  you have to write code so that it waits for iframe to be loaded and then  use your code.

Are you writing this code on load event.  

regards
Rakesh
0
 

Author Comment

by:Larry Trimble
ID: 24477316
Hi...thanks for the answers.  I 'm afraid I didn't explain the problem was well as I should have in the first place, and the error I was getting was to be expected.  I was erroneously trying to access the crmForm.all.IFRAME_MyIframe.SetFocus(); from the onSave event of another form.  I now understand that I need to somehow use the parentform properties.

I'm still at an impass with this but haven't had the time to research any possible solutions.  I did howver find out that it's not possible to set focus to an iFrame...apparently only form entry controls can have focus...textboxes, checkboxes, etc...but not iFrames.
When I switch to the tab containing the iFrames, focus seems to go to the topmost entry control on the page.  In my case, the only entry control is a textarea at the bottom of the tab, so whenever I switch to this tab, the tab scrolls to the bottom and focus is set on my text area.  To overcome this I've had to place a checkbox at the top of the tab.  I've read posts with others having this same issue and there doesn't seem to be a solution.

LT
0
 

Author Closing Comment

by:Larry Trimble
ID: 31583556
I ensured I had the correct case for the iFrame name, and that the restrict x-frame scripting was disabled.  No luck.
There is no on load code at all.  It is a simple display page with no user interaction at all...even within the iFrames.
Thanks for your help anyway.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Desired Skill Set for Microsoft Dynamics CRM Technical Resources – Part I
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question