Trigger A Function From Pop Up Window And Arguments
Aug 14, 2006
I have a main page that opens a pop up window when the user clicks a
link. The pop up window is a menu and when the user clicks the item, it
populates a form input element on the 'parent' window.
My question is: this new populated form element is the value that I use
to change a style.
onchange does not watch this form element because of getelementbyid, so
it doesn't trigger the function needed to change the style. onchange
works fine if I just manually input a value into the text box.
Any other way to fire the function off when the user picks their
selection from the pop-up window? I was thinking I could use
window.opener.function()? But how do I pass the form from the parent
window? From the pop up window, I don't use this.form, what do I
use?something like window.opener.form[0] ?
View 2 Replies
ADVERTISEMENT
Mar 24, 2009
This is related to the pop-up window. Below is the function related to pop-up window.
function openPopUpDetailsMultiple(seqNum ,controllername ) {
if (!popUpDetails||popUpDetails.closed) {
popUpDetails=window.open("GetSCEventAddData?schandle=<!.schandle>&objID=<!.objID>&seqnum="+seqNum+"&controllername="+controllername+,"popUpDetails","toolbar=1,location=0,scrollbars=1,width=600,height=300,resizable=1,left=200,top=200");
}else{
popUpDetails.focus();
popUpDetails.location="GetSCEventAddData?schandle=<!.schandle>&objID=<!.objID>&seqnum=" + seqNum;
} }
The above function is being called in the href link as stated below:
//Draw the event table
document.write("<table border=1 bgcolor=" + contrColor + " cellpadding=3 cellspacing=0 width=750><tr><td width=130 valign=top class=body align=center rowspan=2>" + scEv[i].sceTime + "<br>" + scEv[i].sceDate + "<br>" + scEv[i].sceCntr + "</td><td width=60 valign=top class=body align=center><img src=images/NsaAlarm"+sevIcon+".gif border=0 height=16 width=16 align=middle alt='" + sevText + "'></td><td width=230 valign=top class=body align=center>" + scEv[i].sceCode + "</td><td width=230 valign=top class=body align=center>#" + scEv[i].sceSeq + "</td></tr><tr><td width=620 valign=top class=body colspan=3>" + scEv[i].sceDesc + "<br><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td class=body><a href=javascript:openPopUpCAC('" + scEv[i].sceCAC + "')><img src=images/NsaTools.gif border=0 height=16 width=16 align=middle alt='View corrective actions'>Corrective action code: " + scEv[i].sceCAC + "</a></td><td align=right class=body><a href=javascript:openPopUpDetailsMultiple('"+ scEv[i].sceSeq+"''"+ scEv[i].sceCntr +"')><img src=images/NsaMoreDetails.gif border=0 height=16 width=16 align=middle alt='View more details'>More details</a></td></tr></table></td></tr></table>");
The problem I'm facing now is in this piece of code:
><a href=javascript:openPopUpDetailsMultiple('"+ scEv[i].sceSeq+"''"+ scEv[i].sceCntr +"')><img src=images/NsaMoreDetails.gif border=0 height=16 width=16 align=middle alt='View more details'>More details</a></td></tr></table></td></tr></table>");
I do not know how to send these (scEv[i].sceSeq,scEv[i].sceCntr) arguments. What might be the delimiter for these arguments.
View 1 Replies
View Related
Jan 4, 2011
Ok so I have a site that I want to automatically close the window when the focus is lost from the page. For example, if the user clicks off the page to something else on there desktop I want the page to close. So far I have managed to do this but the grids on my page and the scroll bars all trigger the close function when clicked on. Is there anyway to make the scroll bars and drop down boxes not trigger the function?
This is the code I have so far.
View 6 Replies
View Related
Jan 6, 2007
I'm calling `setInterval(myfunc, 100);`.
That function receives one parameter which seems to be -3, 0, 3, 6 or 9.
This isn't a problem, but I'm wondering what it is. Does someone know?
Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.1) Gecko/20061204
Firefox/2.0.0.1
View 2 Replies
View Related
Jan 7, 2010
I'm a PHP developer that needs to user javascript to open a window prior to a _POST call.
PHP Code:
<title>test</title>
<SCRIPT language="JavaScript">
function newwindow()
{
var myForm = document.header;
var txtValue = myForm.txtUsername.value;
var txtFileName = "lost_logon.php";
[Code]....
I need the window.open to open a new window with arguments attached. For example is the username is bigbob the call should be lost_login.php&user=bigbob. How do I pass the argument?
View 4 Replies
View Related
Jun 25, 2009
Put a link on my page that will open an external site (over which I have no control) in a pop-up window. When the user closes the pop-up, I want my original page to redirect to another page. The difficulty I'm having is that I can't add any code to the page in the pop-up as it's not my site.
View 4 Replies
View Related
Jan 9, 2011
I know in different languages (VB.Net,C++,C#) how to pass an argument to function in this code:
<html>
<head>
<script language="Javascript">
<!-- hide
function openNewWindow() {
popupWin = window.open('[URL]',
'open_window',
'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=640, height=480, left=0, top=0')
} done hiding -->
</script></head><body>
<a href="javascript:openNewWindow();">return to front page</a>
</body></html>
I need to add several links in my page, so I need to pass indexes from links to main function, so I can open images in specific folder with indexes filenames. For example in vb
Subname("text_to_pass_to_SubName")
Public Sub SubName(ByVal function_text as string)
End Sub
View 8 Replies
View Related
Jan 18, 2009
I tried a function like that
function (test) {
var a=document.form.test.value;
}
test is the name of text fields. I doesn't work (undeclared test variable)
View 1 Replies
View Related
Jul 19, 2001
What I want is a loop that will call the same function until it reaches a certain number (let's say 10). Then I want the function to take the parameter passed (the number) and use it in the function where ever you see a 1 below. Basically I want it to run on each element of the pub_name array and from the info gathered define a variable based on the number (example: display_pub_name_*). I have run some tests .....
View 3 Replies
View Related
Jan 23, 2007
I have an external javascript file with certain attributes defined to open a file in new window, which I use for viewing maps. However I need to define different attributes for the height and width, as I want users to open video clips in smaller windows. What do I need to do? Code:
View 5 Replies
View Related
Jul 18, 2002
How can I create a function that takes optional arguments?
View 7 Replies
View Related
Jun 27, 2011
I'm having problems when passing and element from HTML to a script. I have several rows for a person addresses and when one of those fields change I need to update the value of a flag (that is a hidden element).
The html looks like:
<input name="n_address_id[]" value="179" type="hidden">
<input name="c_chg[]" value="0" type="hidden">
<input name="c_street[]" onchange="UpdateValue('c_chg[]')" type="text" value="Street name 1">
[Code].....
View 4 Replies
View Related
Dec 19, 2006
I have a function which can be called with an unlimited number of
arguments.
I want to call another function with exactly the same arguments. I know
I can get the arguments in the arguments object, and as such also in an
array, but how do you pass the elements of an array to another function
as parameters?
View 5 Replies
View Related
Jan 8, 2007
Is there a way to pass arguments to the callback function used inside an addEventListener? I see that I can only list the name of the callback function. For eg, I use this:
var boldLink=document.getElementById('cmtbold');
boldLink.addEventListener("click", rBold, true);
I need the id of boldLink to be accessible from inside the function
rBold()
View 10 Replies
View Related
Jul 20, 2005
Sorry, bad title. Anyway, is there a way to pass the arguments to an object
instantiated via a constructor using the arguments object and have it
expanded, so to speak, so that it doesn't appear as a single argument? I'm
sorry, this explanation is just atrocious, but I can't think of exactly how
to word it. Maybe an example...
Take for instance Function.apply. It takes 1-2 arguments, the first being
the object to use as the context, and the second being either an array or an
instance of the arguments object which are to be the arguments for the
function. I want to do something similar but I want to also basically use
the new operator so that I get back an object.
Here's a snippet of some of my code, maybe this will help:
View 9 Replies
View Related
Dec 13, 2011
I would like to display few calendar fields on the same page with different days disabled. I guess that the easiest way to do that would be to let thenoWeekendsOrHolidaysfunction take care of it but in order to do that I need to pass some values to it. How can I do that?
$('.datepicker:not(.ui-datepicker)').live('click',function(){
alert(this.name);
//var disabledDays = '12-15-2011';
$(this).datepicker({
[Code].....
View 10 Replies
View Related
Jul 15, 2009
How can I pass arguments to a function as elements of an array.[code]
View 1 Replies
View Related
Jul 23, 2009
Using a simple example lets say there is this function in an external script:
Code:
function showmessage(arg){
alert(arg);
}
If we have different scripts eg page1.php, page2.php, page3.php etc
If each one of those scripts calls the function showmessage using different arguments eg page1.php calls it like this :
Code:
<script language="JavaScript" type="text/javascript">
showmessage("page1");
</script>
The above code would have to be embedded into the PHP file.
how can we go about doing that unobtrusively? Ie by not putting the code into the PHP files how can a different argument be passed to that function depending on what page is loaded?
View 5 Replies
View Related
Jan 8, 2011
This example is much simplified as the original script.VBScript is making a value, passes this to Javascript, which puts that value into a div tag.Now, as you see in the VBScript, the value contains a call to a javascript function. It shows perfectly in HTML, but the call can't be made when clicking the link.Is it possible in VBscript to write dynamic hardcoded javascipt function that pass arguments?
Code:
<script type="text/vbscript">
Dim m
[code]....
View 6 Replies
View Related
May 11, 2011
If you specify arguments when writing a function should you still declare the argument variable inside the function?
example:
Code:
or
Code:
View 8 Replies
View Related
Apr 24, 2011
Here is a small snip-it that I'm using to colour lines of a table as a user rolls over them.
function colour(){
var rows = document.getElementsByTagName("tr");
for(i=0;i<rows.length;i++){
[code]....
View 6 Replies
View Related
May 23, 2002
I have a little popup window I'm making. I'd like the window to just destroy itself if the user clicks on the original, calling page.
This is what I tried in the header section of the popup page but the code is not being triggered:
<script type="text/javascript"> <!--
window.
-->
</script>
And by the way I already tried this in the body tag:
And the body tag thing actually DID close the window if the user clicked on the original calling page. BUT the window also closed if the user clicked on a combo box on the popup (because the body lost the focus), and that was not good..
View 1 Replies
View Related
Feb 4, 2010
I have this structure:
Index.html:
<html>
<head>
<script src="jquery-1.3.2.min.js"></script>
[Code].....
This is does not work, how I can send trigger event from iframe to parent window?
View 12 Replies
View Related
May 9, 2009
I want to detect when the window is moved, in order to trigger something. I have managed to get the current X and Y coordinates, but other than checking periodically for changed coordinates, is there a way to do this? I want to be able to trigger the code pretty instantly when the window is moved. Probably not possible without checking every half a second - this would be too cpu intensive right?
View 2 Replies
View Related
Jul 3, 2010
<fieldset class="submit" style="padding-left: 200px;">
<?php if ($site_exist >= 1){
echo "<input type="submit" name="submit" value="Update">";
[code]....
View 1 Replies
View Related
Jul 28, 2011
How would you make a function trigger a other function?
View 10 Replies
View Related