Passing Values In Functions
Mar 13, 2006
Code:
<script language="javascript" type="text/javascript">
function open_win2(var)
{
window.open("link.php?variable=var","Page","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=545, height=600")
}
</script> .....
View 2 Replies
ADVERTISEMENT
Dec 19, 2010
Recently I decided to branch out and learn some Javascript on my own. I'm getting the following error: Uncaught ReferenceError: array is not defined
I don't quite understand why I'm getting this error, as I've created the array in the function showPrompt and it seems as though it's being passed around correctly. However, I believe the problem is with generateBoxes, specifically this part here:
onclick=\"getValue(array, i)\"
(line 39)
Removing array from the function parameter seems to make it execute, but beyond that, i'm lost to what is wrong.
Here's the code:
function showPrompt () {
Obtains user input
var array = new Array();
var box = prompt("Please enter number of boxes","1");
[Code].....
View 4 Replies
View Related
Aug 12, 2010
I'm trying to trap a user entry that cannot be found in the database. When a code is entered, the page should give a "Code Not Found" message if it is an undefined value.
However, it didn't; and it always shows the "undefined" value to the page instead.
Here's what I actually did:
getting user input:
Finding the code:
View 1 Replies
View Related
Jul 27, 2011
I totally understand that in order to learn javascript I need to know how functions work, I understand the basics of passing in parameters and then calling the function with the values to maybe add something together etc I ve read countless articles about functions as well as books etc but I just dont get how they are used and when they should be used etc, the more advanced functions that have maybe 4 parameters and are doing different calculations and returning various values that get fired back into the script just totally confuses me.
What I would like to know is first of all how can I overcome this confusion and also any words of wisdom you may have. I will also add that I have no prior programming experience and have spent the last 2 months frequently hitting my head off a brick wall as I just cant understand javascript.
View 1 Replies
View Related
Nov 3, 2010
To formulate the problem simple i have two buttons with the onclick function:
I guess what im asking is how can you set a variable by one onclick function and then use it in any other function?
View 1 Replies
View Related
Feb 17, 2006
I am working on a simple Expanding Family Tree.
There are two principal Objects: Person and Family,
and two subsidiary ones: Sibling-sets and multi-Marriage-sets.
When I click on a Family Button, I want to display all the Persons
of a Sibling-set.
Married Siblings will have a Button. Pressing this should display
one or more Marriage-Partners. If these Marriages (Families)
have children, they will have a Family-Button.
You will notice the code for the four objects is fairly repetitious,
but that for the variable-length Sibling and Marriage Arrays,
is what has kept me struggling for days.
Lines S04-S10 and M04-M10 appear to be the problems.
Even though I think addSibling() is constructing Sibling objects,
S06 reads the Argument vector as a single item
S07 tells me the argument-count is 1.
so S09 processes only once, and then..
it interprets argv[s] as a single item,
but assigns the whole array to this.sibA.
Can anyone tell me what I am doing wrong? Code:
View 1 Replies
View Related
Jun 10, 2011
Say I have the following code:
And I want this code to print 21.
How should I implement the function Curry?
I tried intuitively:
But it didn't work.
View 6 Replies
View Related
Sep 5, 2010
I'm new here, and new to js. Here is my problem: I have written out a code to make an image switch from state 0 to 1 and back to 0 again (an eye blink). The code works fine, but I would like to write the functions with arguments so it could be applied to more images. I have tried for a few hours (and searched forums) and am getting no where. Here's my code.
Code:
function home_blinkDown()
{
//alert('blink down');
var t = setTimeout("home_blinkSwap('home_js', 'images/main/home_blink.png')", 2000);
[Code]...
View 5 Replies
View Related
Jan 2, 2012
I am writing a small module which will have several different aspects to it, all based around ajax calls. I want to allow the main ajax functions i.e beforeSend, success, complete etc (I am using jQuery) to be customizeable.I currently have an options object in the module which can be extended with an options object passed to an init function. In here, I am passing a 'callbacks' object with nested ojects for each different type of action as in...
var insertCallbacks = {
before : function() {
},
success : function() {
[code]....
View 2 Replies
View Related
Jun 2, 2011
for some time I always found a workaround for this kind of problem. But somwhow, it feels wrong. So I'd like to know, if there's a common way to solve something like this[code]...
I'm defining the function and if the value of 'obj' hasn't until the function really gets called, this can work. But it just feels so wrong do have always global variables just to access them inside of a callback.[code]...
View 4 Replies
View Related
Sep 8, 2004
I would like to call a function with parameters, i.e. multiply('2','3','box1').In this example, the first argument would be multiplied with the second and written into the div with the id="box1". How can I set a default value for the third argument? => so if I call multiply('2','3') then it should automatically set the output-variable to 'box1' if not other defined in the call.
View 7 Replies
View Related
Feb 2, 2010
I'm trying to make a function that will disable elements of a form based on which options are selected.
I have made this work for individual form controls but now i want to make it into a function that could be used on any form control.
Here is the broken function
Code:
I've probably just missed something but i really cant see what?
View 9 Replies
View Related
Jan 27, 2010
I need to use an equivalent of the php function
array_count_values()
View 2 Replies
View Related
Jul 2, 2010
Is there any way we can watch variable values inside javascript functions while running through the debugger. I am using javascript along with ASP.net on Visual studio 2010.
View 2 Replies
View Related
Mar 6, 2006
On my main page, i m having a link for a page which lets user to upload
files to a server.
On the main page itself, i am also taking some other information from
the user. Then i am mailing that data to some other user. The problem
is, i want to email the name of the file that is uploaded by a user
along with the other details. I am able to send all the details which
are entered on the main page, but how do i send the file name which i
am uploading to the server from a different page?
View 5 Replies
View Related
May 23, 2010
I have the following snippet of HTML code:
<table id="identificativo">
<tr id="id_riga">
<td width="40%">
[code]....
View 2 Replies
View Related
Jun 25, 2001
I am trying to pass values from a textarea to an input box or vice-versa....
I am using a function to do this with the onClick method in my submit button.
The value is being passed but only for a second and then vanishes.
Any advice on this? Code:
View 3 Replies
View Related
Oct 29, 2007
I pass values from a child window to a parent window as in this code. Is this secure, and if not how can I pass this data securely?
<script langauge="javascript"> function post_value(){
opener.document.editform.ownerid.value = document.lookupform.ownerid.value;
opener.document.editform.petowner.value = document.lookupform.oname.value;
opener.document.editform.ostreet.value = document.lookupform.ostreet.value;
self.close();
}
</script>
View 2 Replies
View Related
May 20, 2011
I need to make an online payment ( external online payment provider � different domain ) through the IFRAME. I am using ajax and it seems that it is not possible or desirable to open Other sites through ajax and it also does not go with simple GET or POST to pass the data.
The part of the code is here
1 STEP: is getting to calculation page where I have a small hidden form with the infromation which I need to send to IFRAME ( payment provider)
function submitform(event) {
Event.stop(event);
Lightview.show({
href: 'ajax/calculation_page.php',
[Code]....
How can I make it possible that with the button click in this page (calculation_page.php) to open an IFRAME and also to pass the values from the form to the iframe.
View 4 Replies
View Related
Jun 17, 2011
why this is not passing my values?
Code:
myloc="http://owl.ncl-coll.ac.uk/misc/Intraining/Employability_Resources/Confidence/E3_L1_Overcomoing_Hurdles/pages/actionplan.htm?
[code]....
View 12 Replies
View Related
Feb 7, 2011
The developer who usually handles my javascript has been unresponsive in a time.[code]...
View 1 Replies
View Related
Sep 3, 2010
I have designed a simple AJAX form which retrieves information from a MySQL database using PHP/MySQL/AJAX. Here is the code:
HTML Page:
[Code]....
My question is, once I retrieve the information I would like to pass the information (AuxBarcode, DeviceType) as hidden fields to an HTML form. How do I do that? The purpose of this being, we have a form where some information needs to be retrieved from a MySQL database and once retrieved it needs to be passed with the other elements of this form. I just need to understand how this works before we implement it on a full fledged script.
View 6 Replies
View Related
May 10, 2010
have the following problem, i am using jquery ajax to search somes names in my database it work fine till the name have '&' in them, is possible to Post values that have '&' in its content?
View 1 Replies
View Related
Jun 14, 2010
This following script changes style when mousing over a paragraph:
Code:
<html>
<head>
<script type="text/javascript">
[code]...
View 8 Replies
View Related
Mar 23, 2006
I have a parent page who allows user to view an invoice for service. My page bases the date and the value for payment to <%now%> and to <%total_price%>.
However I'd like to permit for users to editing those two fields by opeing a popup window with a new form and asking for these two new inputs. Afterward off corse, this values need to populate the equivalent fields on the parent page.
My questions:
1)I'm opening the new window after a js confirm instead of href or onclick methods, so I don't know how to pass the parent variable ID to the child window..
The code:
if (confirmation) {return true;}else{popupwindow("invoice_editing.asp?ID="id"");}
Problem:
the parentID=request.querystring ("ID") don't work
2)My child window picks the new values from the form... but I don know how to pass back the new values to the parent page and then reload it..
Please, but as much specific as you can to my problems and also please put the whole code of proposed solution, since I'm totally lost.
View 3 Replies
View Related
Jan 27, 2010
i just wanted to know how to pass values from one webpage to other webpage.i have this textfield in the form whose value is going to be same in all the webpages.so when i put this value in my first web page it should come in other web pages automatically how to do that?
View 2 Replies
View Related