passing elements between pages...how??
Moderator: General Moderators
-
firdous_kind86
- Forum Newbie
- Posts: 8
- Joined: Wed Oct 07, 2009 5:06 am
passing elements between pages...how??
Hi all,
i have 2 pages (suppose page1 and page2), i have a form on page1 and a data field in it, from this page1 i have to open page2 and select some data from there and the textfield on page1 gets that populated with that value,
i can do this by submiting from page2 and then another page1 will open and will get that value but i dont want to reopen page1....any ideas??
i have 2 pages (suppose page1 and page2), i have a form on page1 and a data field in it, from this page1 i have to open page2 and select some data from there and the textfield on page1 gets that populated with that value,
i can do this by submiting from page2 and then another page1 will open and will get that value but i dont want to reopen page1....any ideas??
Re: passing elements between pages...how??
Hey a simple way to do that would be to use php and then change the method of your form to GET or POST so that when your form gets submitted it passes the data to the php page and then you can do what you like with the data i.e pass it to another page, insert into db etc.
-
firdous_kind86
- Forum Newbie
- Posts: 8
- Joined: Wed Oct 07, 2009 5:06 am
Re: passing elements between pages...how??
ok, but when i select data in second form and data is inserted in database, and i close the second form, how would the first form display that data without being reloaded, is there a way or is it possible?
the example is same like when u select multiple email addresses on hotmail , a seperate form is opened where u select the emails addresses from the contacts, and when u close, the selected email addresses appear at your parent page.
the example is same like when u select multiple email addresses on hotmail , a seperate form is opened where u select the emails addresses from the contacts, and when u close, the selected email addresses appear at your parent page.
Re: passing elements between pages...how??
Ok to get data back to page one all over again you need to query that db for whatever your looking for, and that would mean refresh but you can set it to refresh automatically if thats what you are worried about otherwise ajax maybe your solution
-
firdous_kind86
- Forum Newbie
- Posts: 8
- Joined: Wed Oct 07, 2009 5:06 am
Re: passing elements between pages...how??
yes exactly, how can a page be refreshed automatically (just need a clue as i am not good at ajax), and can a single element be refreshed
Re: passing elements between pages...how??
ok im not the best at ajax but to start of with you can use php to refresh for u by adding this line after the intended code has been executed,
Code: Select all
<?php echo '<meta http-equiv="Refresh" content="43; url=http://whatever.com" />' ?>;-
firdous_kind86
- Forum Newbie
- Posts: 8
- Joined: Wed Oct 07, 2009 5:06 am
Re: passing elements between pages...how??
thanks for your time..thanks alot
Re: passing elements between pages...how??
Hey, no probs just to inform you the content='43' is the time after it will refresh in seconds dnt no why I put that long I usually give it around 2 seconds. Ps. By the way if need any hadith reference, u no where to go, spread the dawah, ws abu
Re: passing elements between pages...how??
you can use a database and query it..