Retain FORM values after MM_jumpMenu('parent',this,0)

Javascript coding ..

Moderators: macek, egami, gesf

amycrystal123
New php-forum User
New php-forum User
Posts: 6
Joined: Tue Oct 26, 2004 9:45 am

Retain FORM values after MM_jumpMenu('parent',this,0)

Postby amycrystal123 » Tue Oct 26, 2004 9:52 am

I am using the Javascript function MM_jumpMenu('parent',this,0):

//This function refreshes the page with the given id (for instance, event occurs when an option in the select box is clicked.
function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

I have a select box and based on what value I am selecting, the page refreshes (reloads) back to the same page with some GET values.
But, I already have some values entered by the user and I want to retain those values when the page reloads. I do not want to use the GET method as the data is sensitive.

Can you suggest me some way to do this?
Thank you.
Amy.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Tue Oct 26, 2004 11:45 am

well... your current page is:

Code: Select all

$current_link = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];


new link will be:

Code: Select all

$new_link=$current_link."&bla1=1&bla2=2";


I hope that helps

amycrystal123
New php-forum User
New php-forum User
Posts: 6
Joined: Tue Oct 26, 2004 9:45 am

Postby amycrystal123 » Tue Oct 26, 2004 3:00 pm

Hi there,
Thanks for your reply. I had thought of this method, but I would want the data to be sent in a POST method as the data is sensitive. For now, I am sending them as Session Variables and after the use of those variables, I unset the session variables.

I was hoping if there was an other way round.
Thank you.
Amy.

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Tue Oct 26, 2004 3:50 pm


User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Tue Oct 26, 2004 4:44 pm

amycrystal123 wrote:I had thought of this method, but I would want the data to be sent in a POST method as the data is sensitive.


POST method is not an should not be considered any more secure than GET. Just because the data doesn't show on the user's screen doesn't mean it's not there, in plaintext, for all the word to see (download the Live HTTP Headers extensions for Firefox and you'll see what I mean).

There's no substitute for a secure server and https.

amycrystal123
New php-forum User
New php-forum User
Posts: 6
Joined: Tue Oct 26, 2004 9:45 am

Postby amycrystal123 » Wed Oct 27, 2004 7:02 am

Hi there,
Thanks guys for the reply. I checked the website on "Curl" package, but could'nt figure out well what it means. Can you explain to me on that?

Alexei Kubarev -
I do not want my values to be shown as a URL string - firstly, it would not be clean and secondly, there are huge number of values to be sent as a query string, plus I do not want sensitive values like SSN to be shown on the URL string. Is there any other way?

Since the page reloads back to the same page, the values entered by the user are lost.

Thank you for your help. Looking forward for your replies.
Amy.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Wed Oct 27, 2004 7:17 am

hmmmz.. okej... if not to show them in the url, use sessions like you do..
encrypt the infromation if its needed... it would be quite safe...
I thought you would need a jump menu to go to pages and send some GET variables...

Sessions would be the smartest move... or you can combine url and sessions depending on what you want..

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Wed Oct 27, 2004 7:31 pm

I suggest,
for the onchange event, with all the code you have, you should also post the form..
and in the html
echo $_POSt['fieldname'] in the value attribute


Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 1 guest

cron