I have something that runs on a server with no PHP or any of those widgets.
A user submits a form with 6 fields. Clicks "Go". A page appears that displays what he just entered, with a form of his data in hidden fields, and a link with document.form.submit() that takes you to a CGI program. It must be 2 different page loads.
Is displaying what he entered in the form in the next page possible with JavaScript? If so, what are the JS variables that would let me access that data?
I have a div on my page that is populated by a php calendar. The calendar also has month and year input fields so that the user can browse to different months. I would like to create a jquery function so that, when a user changes the month or year field, the div reloads the calendar and passes the selected month and year variable back to the php script. Here is what I have on my page:
<head> <script type="text/javascript"> function startCalendar(month, year) {
Alright, I'm trying to make these variables pass through as a post, but it's not receiving any posts through the other side. When I use the GET method though, it picks it up.
There are different ways by which values of variables can be passed between forms. One of the ways is to use the setTimeout to pass the values or data. Here the biggest advantage is we can pass data to a different site even running automatically.I would need from someone a bit of help to pass the variable links from form1 to variable strLink in form2 using SetTimeout.We have the following schema:An options select menu where value of the option, sent with a submitted form, is specified with the value attribute. In the absence of a VALUE attribute, the value is the content of the option element.
How can I send POST variables to a new window on form submit. I tried the below but what happens is the new window "foo.php" opens but no POST variables are present and also the parent page refreshes when I want it to remain static. Code:
here it he code I have that is pulling the variables from the URL
function getUrlVars(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
[Code]....
and here is the code I use to alert
var hash = getUrlVars(); alert(hash['pagego']);
this works perfectly and alerts with the variable when I load he page.
Now when i am embedding my flash file i want to pass the variable to my flash by just adding the variable value to my embed code.
how can I do this?
here is my swf embed code
var so = new SWFObject("main2.swf?pagego="+THIS IS WHERE I WANT THE VARIABLE TO BE, "Preview", "100%", "100%", "9", "#ffffff", true); so.addParam("scale", "noscale"); so.addParam("salign", "lt"); so.write("flashcontent");
how can I make ajax pass variables to php, I been trying to use $POST but it�s not working for me, I have this script
Code JavaScript: function get_school_data() { var xmlhttp;[code]....
What I am trying to achieve is to send the value of country to php and have it stored in a variable so I can then select a different table in the database, but when I do it the way I am, it does not work, as it gives me an undefined variable
I have a php page (target_market.php), with a form that has 34 checkboxes. I would like the be able to click the boxes and have JS post the 'checked' value to a php session varibale when a button is clicked. If the user navigates away from the page and returns, the pages needs to reload the checkbox session variables.
How do I post the 'checked' value as either YES or NO using JS to another page (target_session.php), so that i can add them to database at a later stage?, but also retrieve the session variables and update the check boxes should the user come back to the target_market.php page?
I have acollection of local variables populated via Flash movies and scripts, and now I need to submit an ajax post (can also be get, but prefer post). I have tried:
The problem with this is the encoding of the localParam1 and localParam2 sometimes breaks the normal & delimeters. An even more problem is I sometimes haveupwards of 25+ local variables that I need to submit. These inline +s makes it feel, and look, like one huge hack - not to mention the encoding. One last restriction: I cannot use any jquery plugins due to the company's policy. So, I'm looking for something small and light as a solution - not a plug-in. Isn't there an easy way to do this? ONe thought I had was to create a new <form> on the page, and insert the variables as new <input /> fields - and then finally submit the entire form. Again, a big hack + css
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:
On my webpage I'm using a script that allows users to reorganize some elements in a list. Clicking the "save order" button calls the code below which goes to /fbedit.php?view=favs&order=[a comma-delimited list of numbers is here].
The problem is that there is too much data for it to be passed this way, so I need to use POST instead of GET. If someone could explain how I could redirect to this same page but pass that comma-delimited list via POST that would be great.
I have a website that uses a custom built webserver to serve the pages. (Please don't ask me why my boss had his own web server written). I am displaying a log of information that is an unknown number of rows. This is currently displayed in a table.
The table is generated by some code that we had to write (thank you custom webserver) so that the webserver will parse HTML files and fill in the tags we created with some data before returning that to the browser, the HTML looks a lot like ASP or JSP using the <% %> tags to denote something to be filled in.
Now all that works fine and dandy, but in order for this log of information to show the latest stuff, the page needs to refresh and tell the server to go get the list of log info and fill in the HTML with the info then return it to the browser. All this happens pretty quick, but like any site, the page blinks while it refreshes.
Now my boss wants that page to update without refreshing (the blink annoys him apparently). At first I said that it couldn't be done, but he said that he didn't believe me. Thus I am forced to ask you guys.
I know you can update fields like that using JavaScript. (I made a font tag with an id and a JavaScript function resets the nodeValue. This changes the text without refreshing the screen). But my problem now is that I need to POST to the server to get the information without the page refreshing (through JavaScript?). Is this even possible? I planned on getting the data back and document.write() it all to the page.
Is there a way to retrieve POST data submitted from a form using Javascript? I know I can use PHP, but for lengthy reasons I cannot so I only have JS to work with.
I was just reviewing some javascript pop up window functions on my website and I descovered something... that I set the exact same variable name twice for both functions... which is bookWindow. I tested this for pages that use both functions and both types of pop windows work no problem. Is there a problem in that I use the same variable name twice? Is this considered bad form? Or maybe it makes not difference at all because the variable only gets used when it is called upon and then it leave memory.....
I have some image data in a Javascript variable, and I want to display it. I have a technique which works in Firefox but not in Internet Explorer :
<script> var testImage = <image data as a string> </script>
<img src="javascript:testImage"></img>
I understand that this should work in Javascript 1.2 and above, which supports null characters in strings. Does anyone know why this doesn't work in Internet Explorer?
can anybody put forward a sensible argument javascript's behaviour of creating a new global variable whenever I assign to a previously undeclared variable. I can't beleive this is just for the sake of convenience (surely we learned this much from basic).
here's my proposal: all "global" (document scope) variables must be declared by 'var' outside a function block.
failing that, does anyone know any patterns or tricks I can use to make sure I don't create a new global variable when I accidentally misspell a variable name?
Here's the situation. I have a static html page which we want to update to include some dynamic content. I want a counter that keeps track of the number of times anyone presses the "add" button, and display that number. So, that page would look something like:
Number of calls today: 5 Add | Reset
The "5" would increment with every click of the "Add" link. The "Reset" link would reset the counter to 0.
I have a Perl script that does all of the accounting stuff (opens a file that contains the number, increments it, resets it, etc). What I don't know how to do is to get the data from the CGI script to the web page. I'm imagining that you can use Javascript, but I can't figure it out. My CGI script can accept three options (add, view, reset). So it you call it like so [myscript.cgi?action=add], it increments the counter by one.
So, in a nutshell, this is what I want:
1) the web page to display the # of calls upon load. 2) When a user presses the "Add" link, it invokes the CGI script to handle the accounting stuff, then refresh the page with the new number of calls. 3) When a user presses the "Reset" link, it resets the counter to 0.
I was handed a project that, when launched, had some ajax problems--specifically, "Error: uncaught exception: Permission denied to call method XMLHttpRequest.open." That's easy enough to fix--found the call in the .js file that was referencing the development server instead of the live server, and I am aware of Javascript's same-origin policy, which makes good clean sense. Change that call, problem solved.
Unfortunately, it's not solved. I can change the reference from var url='http://www.devserver.com/function.php?id='+id; to var url='http://www.liveserver.org/function.php?id='+id; but that doesn't solve the issue of if someone comes to the page without the 'www' or to the other domain, whose TLD is a .com instead of .org.
In PHP, I'd simply write the function to dynamically generate the url string, using $_SERVER variables rather than hardcoding the url. But I'm no javascript guy. Any help would be appreciated.
I'd rather not have to put a php redirect in every page to make sure the url is what I want it to be. I'd much rather learn something new about Javascript.
A while back I was working on learning C++. However after finding out that making API's was too difficult I switched over to HTML and Javascript for a while to get it to do what I want without having to fry my brain on weird code statements.
Well now I've reached the barrier of being able to save data. For a while I've just had it to the point where the code I need is saved in a textarea and I copy and paste it in notepad. Then upon reentering I pull it out of Notepad and paste into the testarea.
Well enough with the bla bla bla. Is there a way I can use the <form method="post"> stuff to pass a variable to a C++ compiled program?
All I need to know is: 1) can I use <form method="post" action="SomeProg.exe"> and 2) what would the name of the posted variable be to use in my C++ code? As you can tell I running client-side so PHP and other server-side languages that WinXP don't support without special installation wont work.