![]() |
| ||
| Passing data from forms from one page to another Hello, Does anyone know how to submit forms from one page to another page? If you don' mind can someone explain how, or if they know a good tutorial, either of these would be great. Can this be done in javascript? Thanks |
| ||
| Re: Passing data from forms from one page to another I believe it's either done using cookies, or by passing (small quantities) of data in the url. E.g. I use php to pass data on one of my sites: you create an image id number, e.g. 0000001. You link using www.mysite.com/pic.php?imgid=0000001 The second page then reads the variable imgid as having a value of 0000001. It makes a page in my templated style with 0000001.jpg in the middle, 0000001.txt included below it. This means my one page produces up to a million image preview pages, all in my template. If you can't get any help with it let me know and I'll see what I can suggest. |
| ||
| Re: Passing data from forms from one page to another Quote:
You can do it a variety of ways -- one being what DaveSW suggested. In PHP, at least, you don't need to pass it as a URL variable. Forms using the POST method (which is... well.... yeah, duh)... can send variables to the next page, you just have to write the code to grab them. Easy enough to do. What language do you want to use? What are you trying to accomplish -- do you have some starter code I can look at? I'd be glad to help. |
| ||
| Re: Passing data from forms from one page to another Well I found an example from another page, but I want to do it in javascript, and here is the code that I got. This is the form I am working with: <form name="input" action=""> I don't know what action to use or if there is any other part that I need for javascript, and I don't know the code for the recieving end page. Thanks |
| ||
| Re: Passing data from forms from one page to another the said javascript that cooresponds to the submit button, takes on the form: document.formname.submit(); |
| ||
| Re: Passing data from forms from one page to another does that go in value so: value="document.formname.submit()" or does it go in action like this: action="document.formname.submit()" Thanks |
| ||
| Re: Passing data from forms from one page to another I would have put it in a function... but you can put it as an action if you want....such as <input type="button" value="hi" onClick="document.formname.submit();" /> or in a function.. because I like to test the form values with javascript BEFORE submitting it to the server-side. function check_values() |
| ||
| Re: Passing data from forms from one page to another I am not using a server, how do u submit using a cookie |
| ||
| Re: Passing data from forms from one page to another Hi, I hope its not too late to ask another related question on this. I am also trying to the same thing, passing data from one page to another, using javascript and html. From the replies in this post, I can send data from my input page. But after that I have to display all the sent data (username, address, location etc.) in the new page. How do I do that? thanks |
| ||
| Re: Passing data from forms from one page to another These are the fuctions you need. I suggest you make a file called cookie.js and include in your html file like this: [HTML]<script type="text/javascript" src="cookie.js"></script>[/HTML] and the javascript to place in the cookie.js file: // This code has served me well :) Dance |
| All times are GMT -4. The time now is 8:30 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC