Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form and browser

Status
Not open for further replies.

Palmke

Programmer
May 12, 2004
16
IT
Hi all,

I have made a form in php and I use Javascript and event handlers to write on some fields of the form when an event occurs,
everything works fine but I have a problem now :
let's say the first form I use some buttons and so some events occur and it update the fields of the form with :
document.forms['myform'][myfield].value=...;

the problem now is that the next time I load a form for a different user if I dont close the browser and open again, it saves the changes I do now plus all the other events of the last times.

May anybody help please?

Best regards,
Palmke
 
I'm not quite sure I understand your problem, but it sounds like you need to disable the browser's cache.
Code:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="EXPIRES" CONTENT="-1">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 

Can you exaplain the problem in more detail - it's not too clear what you are trying to describe.

Thanks,
Dan
 
I'll try to do my best,

I have made a form in php with some fields,
then whenever you change some of those fields,
event handlers call a function that I wrote in JavaSscript that calculates some datas and then at the end of the function there is :

document.forms['myform']['fieldnumber'].value=d;

it puts the value d in the field number of the form.
So it works fine the first time I compile the form for every field I change.
This actually (the store) happens when I push submit button in the form,
then it automatically reloads the page and if I push submit button without changing any fields,
it puts the same value in the same field number of the last compiled form, as I pushed the buttons again while I didn't.

Hope I was more clear now :)

Best regards,
Palmke
 
to Adam :

thanks for your reply,
if I put that in the code it gives me Syntax error.

Palmke
 
Palmke... those meta tags don't go in your code - they go between the <head></head> tags of your HTML page.

There's always a better way. The fun is trying to find it!
 
yeah,my bad but they dont help anyway :((

May I ask something?
It seems that you know this language very well,
where do you find good information?
I mean would you suggest me a good site or a good manual please?

Best regards,
Palmke
 
I have a program in PHP and Javascript script inside, I dont know where to put that line, I put in my php program or in Javascript, without errors but both dont work.


Best regards,
Palmke
 
It seems that you know this language very well,
where do you find good information?

Well, IMHO (short for In My Humble Opinion) this is just about the best place for specific information although if you have the time to read through all the posts you wouldn't go wrong. The other place is the Javascript Reference ( as well as your friendly search engine.

As far as your other question:
I have a program in PHP and Javascript script inside, I dont know where to put that line, I put in my php program or in Javascript, without errors but both dont work.
Maybe you could paste your code here so we can all take a look at it and maybe find the problem. ALWAYS out any code you post between [ignore]
Code:
[/ignore] tags like this:
[ignore]
Code:
do this
do that
do the other
[/ignore]

this preserves the code as you want us to see it. And don't overlook the PHP forum as well!

Oh, and one more thing - be as clear and specific with your post as possible. The more information you can provide - exact error messages, what you expect the code to do, what the code is actually doing, etc. - will go a long way in getting a fast and accurate response. And it's always a good idea to "close" your post by letting us know what worked.



There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top