Changing Value Of Input In Parent Document?
Jun 3, 2011
I have the following structure:
Code:
<html><body>
...stuff ..
<input id="test-input" type="text" />
[Code]....
but the problem is, iframe and document are on different domains, so I can't access parent.document
Is there some workaround for it? I have full access to both top and iframe document, so can add any javascript to both.
View 4 Replies
ADVERTISEMENT
Feb 28, 2002
I'm building a program for webmasters, and I need to have it so that I can have an <INPUT> button that, when clicked, will open up a new window (400x350 pixels) with a list of links. However, when the person clicks one of those links, the window closes, the value of an <input type="text" name="parentdoc" size="8" maxlength="8" readonly> is updated.
How would I accomplish this?
(As I mentioned above, I am very new to JavaScript, so please provide as much explanation and code as possible.)
View 6 Replies
View Related
Feb 2, 2011
I am trying to dynamically clear the value of a form input field and then submit the form.When I used $('#my_field').val('') to clear the field, it was cleared on the screen but when the form was submitted the original value of the input field was posted.My browser is FireFox and I can see using FireBug that when the field is cleared, firebug is still showing the html code with the old value. E.G. <input type="text" value="old_value" />The same situation occurred if I used $('#my_field').attr('value', '') to clear the field.The same situation occurred if I actually changed the value of the field rather than just clearing it.To work around this problem I ended up using the $('#my_field').removeAttr('value') to clear the field before it was submitted.
View 1 Replies
View Related
Jan 26, 2011
I have 2 windows - parent and children.
in parent
<form name="calc" action="" method="post">
<input value="0" type="text" name="pay" id="pay">
</form>
in child
<form name="payment" action="" method="post">
<input value="0" type="text" name="pay_str" id="pay_str">
</form>
how can i transfer data from parent input to child input?
View 3 Replies
View Related
Jan 29, 2007
I need to change the class of the 'a' tag within the li that has the nested ul e.g
<div id="menu-container">
<ul class="main-menu">
<li>Link 1<a class="menu"></a></li>
<li>Link 2<a class="menu"></a></li>
<li>Link 3<a class="menu"></a>
<ul class="sub-menu">
<li>Sub Link 1<a class="active-menu"></a></li>
<li>Sub Link 2<a class="menu"></a></li>
</ul>
</li>
<li>Link 1<a class="menu"></a></li></ul></div>
I need to change it to "active-menu" and the nested a to "menu". I cant change the HTML at all, I wish I could.
View 3 Replies
View Related
May 11, 2006
I've got a problem calling parent.opener.document within Internet Explorer version
6.0.2900.2180.xpsp.050928-1517. The call leads to a script error 'Unallowed memory access'. Within older IE version and other browsers it works fine.....
View 4 Replies
View Related
Aug 25, 2003
I have the following code in a popup window.
Code:
<td bgcolor="#000000" onClick="javascript:setRGB(0, 0, 0);" class="swatch"></td>
<td bgcolor="#000033" onClick="javascript:setRGB(0, 0, 51);" class="swatch"></td>
<td bgcolor="#000066" onClick="javascript:setRGB(0, 0, 102);" class="swatch"></td>
What I want to do is to define the setRGB function so that when I click on a color swatch (onClick) it updates 3 fields in a form in the window that opened the popup with the corresponding RGB values. So let's say that in the window that opened the popup i have a form 'formname' with three text fields named 'red', 'green' and 'blue'.
View 2 Replies
View Related
May 21, 2007
I have an html that has a form for example
<form method=post action=blah.html>
<input type=hidde name=myHiddenVar value=''>
blah blah blah
<iframe name=myiFrame frameborder=0 scrolling=no src="anypage.php">currently loading</iframe>
</form>
now in iFrame page (anypage.php) I want a button to control or SET the value of the main FORM (html page) and its variable myHiddenVar, for example here is what I tried and it didnt work...
in anypage.php I hade a button
<input type=button value=change onClick="javascript:parent.myHiddenVar=100">
but the aboue didnt work, is there anything like docuemtroot ?
View 1 Replies
View Related
Nov 8, 2006
I have a parent document which has an iframe loaded in it. The iframe has an textfield element. I want to access this textfield element from the parent document. I have tried the following. But that doesn't work.
(from the parent)
window.frames['frame01'].document.getElementById('idname')
I always get as null.
View 1 Replies
View Related
Jul 20, 2005
I have a main page:
--------------------------------------------------
<html><head><title>Test</title>
</head><body>
<img id="img_a" name="img_a" src="image_1.png" alt=""><br>
<object width="0" height="0" type="text/html"
data="/cgi-bin/next_img?img_a">
refresh image
</object>
</body></html>
--------------------------------------------------
and a script next_img generating this code:
--------------------------------------------------
<html><head>
<script language="javascript1.2" type="text/javascript">
<!--
function doLoad() {
setTimeout( "refresh()", 15 * 1000 );
}
function refresh() {
window.parent.document.images["img_a"].src = "image_2.png";
window.location.reload( false );
}
//-->
</script>
</head><body onLoad="doLoad()">
</body></html>
--------------------------------------------------
The Script specifies a new image (image_2.png) and the duration (15 sec)
to show the new image. On timeout the script is called again. The main
page may hold more than one image and object.
The Script looks nice on Mozilla Firebird but can't find the images in IE 6.0.
I also tested some variants of refresh() like:
function refresh() {
var image = window.parent.document.getElementById("img_a");
image.src = "image_2.png";
window.location.reload( false );
}
but no success.
View 1 Replies
View Related
Mar 5, 2010
i have a dropdown menu wrapped in a div attached to this div is the onmouseout event which hides the div this is working the problem however is when moving from 1 link to the next in the dropdown the onmouseout event of the wrapper div is firing and hiding the div prematurely [URl]
relevant code:
<div id="roster_drop" class="drop_menu" style="left: 128px;" onmouseout="this.style.display = 'none';">
<a href="roster.php">Superstars</a>
<a href="champions.php">Champions</a>
<a href="titlehistory.php">Title History</a>
</div>
how do i make the event only trigger when your mouse leaves the div itself and not crossing onto a link
View 1 Replies
View Related
May 18, 2010
I have an iFrame on a page where I am calling .mouseup(function()) on it's document child.Once in the mouseup function, I need to refer to a specific sibling of the iFrame.Unfortunately, I cannot figure out how to traverse backwards to the iFrame element from $(this) - where $(this) is the document. I get a null set returned when I try$(this).parents().
View 1 Replies
View Related
May 28, 2009
I'm working on a project and within a document I have content being loaded into an iframe. When a user clicks on an item in the iframe, a pop-up div is loaded using the facebox plugin but it's obviously contained by the iframe. Is there any way that I can pull that element out of the iframe into the parent document? Or at least position it so it looks like it's part of the parent document and not the iframe? My reasoning for this is sizing and positioning. I want to expand the size of the facebox div and position it over top of some of the parent document elements but, since it's within the iframe, I'm limited to the size of the iframe and positioning is limited to being within the iframe.
View 2 Replies
View Related
Jul 21, 2009
I'm experimenting with creating SVG dynamically and am finding that document.createElement is changing the case of the tags I input. This is breaking because, apparently SVG tags are case sensitive. For example, when I try to create a linear gradient element like so:var grad = document.createElement('linearGradient');what appears in the view source is:<lineargradient ...> (Note the lowercase "g")The tag doesn't work if the "G" is lowercase. Is there any way to specify in the <html> tag (or somewhere else) that the document should preserve tag case?
View 1 Replies
View Related
Sep 14, 2010
I have a webpage with an IFrame in it. The content for the IFrame could change per page and with it size. I don't want scrollbar's inside the IFrame but rather for the whole page. To accomplish this I must resize the height of the IFrame (width = fixed). But I can't seem to accomplish this. The links within the Iframe load the new content but I have to access the parent document to be able to resize the IFrame height. How I can resize the iframe from within javascript in the IFrame.
View 10 Replies
View Related
Jun 14, 2011
Simple question here. I have an input inside a div. When the user hits the escape key, I would like the input and the parent DIV to be removed.
[Code]...
View 4 Replies
View Related
Jul 7, 2009
I am writing a modification to Invision Power Board that makes replying to post via Ajax.
The "Submit" button is being overrun by Prototype's observe function. When the custom function is executed, I run Event.stop(e) to prevent the actual form from being submitted and reload the page.
I have developed and tested on Safari but users began to report bugs in IE, after investigation I discovered that the line
Code:
Is making IE execute all the code after it, and then execute its own onclick() function as if Event.stop(e) was not there. Commenting this line fixes the problem, the page is not reloaded, but this line is vital to the code.
So why do I need to set the anchor? To support the back button function after a user makes an ajax reply, pressing Back should hide the new content, and pressing Forward should make it visible. (e.g. every time the anchor is changed) This all works nicely. But not in IE.
This only happens the first time the page is visited ever, or clearing cache and visiting it again. Reloading the page fixes the problem but this is not normal behavior and users shouldn't have to reload to use the Ajax fast reply...
View 4 Replies
View Related
Jul 8, 2009
I have a div within the div a table with input field
Code:
<div id='main' >
<table id='tabReg' >
<tr>
<td><input type="text" name="abc" id="abc" /></td>
</tr>
</div>
How i can find the parent div of this input field for example someone type into the input field on keyup we want to find the parent div of this input field
View 1 Replies
View Related
Oct 18, 2005
This code:
if (stealth)
{
document.searchme.query.type = 'password'
}
else
{
document.searchme.query.type = 'text'
}
works in FF but not in IE 6. It fails with "Error: Could not get the
type property. This command is not supported."
A previous post mentioned that in IE type is 'read only'.
Are there any work around for changing input type dynamically in IE?
View 5 Replies
View Related
Nov 4, 2010
How do I change the value of "id" of a text input field?I am using the function attr (), but it seems every time I call the function adds an id.$ ("input.buscaf.") attr ('id', obj);"obj" is the value of the id which will be exchanged.I have to change the value of the id because I'm using masks values.
View 3 Replies
View Related
Aug 12, 2009
I have a table with a list of items which currently show 8 items per page. I want to have an input box at the top of the page so if I want a different amount of items to be shown i enter the number and the page alters the pagination to what ever number is entered.
View 7 Replies
View Related
Feb 17, 2009
At the momment, I am using this code to change the value of the HTML input box.
Code:
success: {
callback: function(results) {
alert('Completed in ' + results.moves + ' moves and ' +
+ results.seconds + ' Seconds.');
[Code].....
However, the problem is that it also changes the value of the input form Submit button. How can I change the code so that it only changes the input box of a certain ID?
View 1 Replies
View Related
Feb 5, 2010
I've got quite a challenging problem (for me) with jQuery and highlighting a parent <li> from activating checkboxes.I've got a nested unordered list which contains checkboxes... Example HTML:
<ul>
<li class="main_first"><span>Main Item 1</span>
<ul>
[code]....
View 3 Replies
View Related
Dec 26, 2009
Is it possible to Copy data from a <input> box the the main windows (the input is opened in a pop-up). I've seen date-time pickers can do that, but can't find the function!
View 3 Replies
View Related
Jul 23, 2005
Ciao, I have an hidden field and I want make it visible, setting its "type"
to "text" from a popup window.
I'm using this code:
window.opener.document.forms['formInsegnamenti'].elements['giorni_1'].type
='text'
it works fine in Mozilla but fails in Internet Explorer 6.
View 2 Replies
View Related
Jul 23, 2005
I'm making a <select></select> with lots of <option></option>. It
contains all possible options. Because of the length of the list, I
also have an <input type="text">.
This is what I wish to do:
onKeyDown I want all options that don't contain (or begin with, it
doesn't matter which one) the typed letters to be removed from the
<select>.
My problem is that I don't know of any code to find words and identify
letters.
View 4 Replies
View Related