tags:

views:

25

answers:

1

Hey all, i'm just wondering if there was any way to condense this line of code to pure jQuery without having the need to have ".contentWindow.document.getElementById('email_box').value" in there?

 $('#OIPHPFrame')[0].contentWindow.document.getElementById('email_box').value = $("#txtEmail").val();

and also the "click" event:

 $('#OIPHPFrame')[0].contentWindow.document.getElementById('butImport').click();

Any help would be awesome! :o)

SOLVED! :o)

 $('#OIPHPFrame').contents().find('#password_box').val($("#Password").val());
 $('#OIPHPFrame').contents().find('#butImport').click();

David

+1  A: 

I think...

$('#OIPHPFrame')[0].find('#email_box').val();
$('#OIPHPFrame')[0].find('#butImport').click();

...should work.

David Hoerster
sadly it says "Error: $("#OIPHPFrame")[0].find is not a function"
StealthRT
Got it working with your help there, D. Thanks :o)
StealthRT
Glad I could help! Frames are, unfortunately, a necessary evil still.
David Hoerster