I have some JavaScript which is splitting out the different variable elements from the URL.Now, how do I set the internal variables?Then I want to set the variable ScriptHeading to be Change and the variable ScriptType to be NewThread.I keep finding all sorts of lovely code showing how to split out the various sections in many different ways, but I can't find anything on how to actually set these variables.
How can I go about setting a number of variables using a table which will have the variable names to be declared in one table. The data to be assigned will reside in another. As an example, I know this assignment works:
var nam0 = tab[0] var nam1 = tab[1] var nam2 = tab[2] .. .. ..
What I would like is to use two tables
var namtab = ["nam0","nam1","nam2"] var tab = ["va0","val1","val2"]
Then using a loop, assign the variables so that I may address them by name "nam0" rather than namtab[0].
var nametab = ["nam0","nam1","nam2"] ** also tried w/o the quotes for(var i=0;i<3;i++) { var nametab[i] = crumbs[0];
I am passing a URL via the GET method url variables. The original URL looks like this:Code: The actual site is done in coldfusion and I do not have access to that or any other server side languages. PG=FORUMS is the page that contains the iframe and I need the iframe src to be the same as the "page" variable.I attempted to throw together some scripts I found online and this is what I came up with:
Am trying to create a link on a simple html site, using Javascript, to create the URL in an HREF. The file I'm trying to link to changes each day and uses the date as it's name.
Is it possible to input var x for example into "<font size:"x">" and make it higher each time I push a button? Or is there any other way to make text or table or picture or whatever bigger, smaller or just differ it after an event?
I have been working on a few budget scripts that I can access from the web in using HTML. My problem is that when variable values change I need to change these values in all of the HTML files on the server. I know that there is a way to declare global variables in a single file and use those values in another file but I have not been able to find any information that tells me exactly how to do this. I have tried to put it together on my own using what little informaiton I have been able to find but have not been able to get this to work. Is there a more detailed referance that I can find somewhere or does anyone know what steps I need to take to make this happen?
I have an external js file used by an html page but I want to use global variables defined in the html page in the js file. for example...
<html> <head> <SCRIPT type="text/javascript" var test = "1"; </SCRIPT> <SCRIPT type="text/javascript" src="jscript.js"> </SCRIPT> </head>
So I have var test which is defined in my .html but my jscript.js also uses the variable. I am doing it this way because I have a lot of pages that are simular using the jscript.js functions but each page has different quantities and values of variables used.
I need help getting variables in an external js file to transfer to the html page that uses them. I have an html page that lists verses to memorize, which, when the mouse hovers over a particular verse, a small popup reveals the book reference for that verse, thus giving a check to see if the user has accurately referenced that verse for its source.
I have an external js file (VERSES.js) that houses the verses and popup references sequentially as elements in an array and then writes them to the html document. A simplifed version of what I am using, with only a few verses listed here as an example, and that works beautifully, is given below: Code:
myNum[] is a hidden variable and partNum is the name of a text field that has many instances i mean there are many textfields with the same name so it forms a column in a data table.
function validate_form(){ if(regform.reguser.value == ""){ alert("Please completed the selected box");[code]....
to validate a simple registration form, however I initially tried to streamline this function by cycling through an array using a loop to point to various input elements in the HTML page itself. I found that when trying to use a variable in the aforementioned if statements the javascript failed to work i.e.
var test = "reguser"; if(regform.test.value = ""){ }
I know the javascript is looking for the input element "test" instead of "reguser" but is there any way I can force it to look for the contents of the variable.
I'm trying to save the input and pass it into the URLs that are the option values. So Artist ID being 111 would take you to url..../<WHATEVER OPTION YOU CHOSE FROM DROP DOWN>/111 What am I doing wrong/What am I not doing?
I have a program written in Javascript and fully functioning which takes a user-selected directory name and then displays all the photos in that directory in a certain format.
I am now wanting to expand the program to allow users to optionally enter their own strings and the program will use all the photos from www.flickr.com which use that string as a tag.
I have a PHP interface to flickr (called PHPflickr) which collects all the relevant photo urls. I now need to get these images back into my Javascript so I can process them using the existing functions (rather than rewrite all my functions in PHP code and have two sets of functions in the program). I found on another thread a means to do this for a date variable:
but being completely new to PHP I'm not sure what "addslashes" might be or what formatting will be necessary if I am starting with an array of urls. Code:
How can I then use this variable to access the opener of 'window' ?
Meaning, I dont want to access it as such:
window.opener
but as: window.+newVariable
So it uses the contents of newVariable to access the opener.
I need this because I have a couple of variables which I need to concat to eachother as a string, and this string in turn is the variable I need to access from window.opener.varSomething where varSomething is the variable that stores the variable I need to access.
I use ASP to obtain data from a database and I have a piece of javascript code I use on my website. I want to use the database variables in my javascript. I'm not very familiar with javascript, but here is some info similar to what I'm trying to do.
Not sure if php is the best solution or maybe javascript. ( or both.)
I am writing a litle script that will go to my mysql table and take out 20 rows ( from about 10,000 rows ) based on the WHERE statement.
Then I want to step through these 20 rows displaying just two filds in this fashion:
First, I want to display one field in a "box" ( using divs and css ) then wait for a form input. Then while keeping the first displayed box and field display the second field in a similar box a fee lines below. Wait for a form input update some data.
Then onto the next row.
If I use javascript then I could keep all the processing on one page and not have to have server refreshes.
But how do I get these those array elements from $row['field1'] and $row['field2'] into javascript vars ?
Is this the best way to do this ?
Or would php and having a couple of extra trips to the server for form processing be better ?
I would like to multiply combo_1 and combo_2 to give an outcome and display it in the textbox of txt_price using javascript. f['txt_price'].value = (f['combo_1'].value).toFixed(2);
This is something I was working on but no results so far. <form> <select name="combo0" id="combo_0" onChange="change(this);" style="width:200px;"> <option value="0">-select-</option> <option value="1">Canada</option> <option value="2">States</option> </select><BR><BR>
<!-- I would like to Multiply this field --> <select name="combo1" id="combo_1" onChange="change(this)" style="width:200px;"> <option value="1"></option> </select><label></label> <BR><BR> <!-- and this field --> <select name="combo2" id="combo_2" onChange="change(this);" style="width:200px;"> <option value="1"></option> </select> <BR><br> <!-- To present an outcome to this field --> <input type="text" name="txtPrice" id="txt_price" onChange="change(this);" style="width:200px;"> <BR></form>
I need to create a variable out of nothing. From a database I extract an item with a certain id. With this id I want to create a new variable. For example:
id = 36;
"item"+id = new Array();
Now I get the message "Illegal left hand assignment".
I tried:
eval("item"+id) = new Array();
Is it possible to create a variable out of nothing?