Setting focus to a textbox using Jquery
Last Post 02-06-2013 09:06 AM by Steve. 3 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages Not Resolved
SteveUser is Offline
new to the springs
new to the springs
Posts:3
Avatar

--
02-06-2013 08:18 AM

    Hello,

    I'm trying to set focus to the first control, a textbox, on a dynamic form.

    I've tried the following JQuery code inside the header field of a DNN html module:



    Where 'dnn_ctr1219_DynamicForms_TBR_GUID9ad85ae1-23a4-48b1-a081-a383fbd499f1Name' is the ID of the textbox.

    This works, in the sense that focus is set and I can start typing in the textbox. But the cursor stops blinking and disappears altogether depending on where I move the mouse cursor.

    So I tried putting the same code without the block in the form itself. I put this at the following location:
    Module Configuration > Advanced Coding Options > Custom JavaScript File > Initial Javascript
    I couldn't see any reference to JQuery, but i thought it would be worth a try. This worked by setting focus but the cursor behaved as above.

    I tried using the same code on a textbox that is not inside a dynamic form and this worked perfectly.

    So could someone please tell me what I am doing wrong? How can I set focus to a textbox and make the cursor blink normally?

    Also, where JQuery code should go within a dynamic form?

    Do you have any examples of how to use JQuery in a dynamic form, I couldn't see anything in the user manual.

    Best Regards,

    Steve

    SteveUser is Offline
    new to the springs
    new to the springs
    Posts:3
    Avatar

    --
    02-06-2013 08:26 AM

    Hello,

    I've just discovered that the code works fine in CHrome but not in I.E.9.

    Also that I'm running DNN 6.2 and Dynamic Forms 4.10.4

    Regards,

    Steve

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    02-06-2013 08:45 AM
    Hi Steve - I would suggest possibly trying some other browsers too and the tools within them such as "Console" or "FireBug" etc... Each browser has its own things such as IE Webmaster Tools or Safari Developer Console etc... These should show you the exact error or allow you to test the JavaScript and see what error is happening.

    I believe we showcase a few implementations using jQuery within Demo 20 and Demo 28 at http://www.datasprings.com/formdemos.

    Thanks!

    -Chad
    SteveUser is Offline
    new to the springs
    new to the springs
    Posts:3
    Avatar

    --
    02-06-2013 09:06 AM

    Hi Chad,

    Thankyou for the reply. I can see it works fine in Firefox too, so seems to be an IE problem.

    Thankyou for your tips.


    Best Regards,

    Steve



    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi