I'm working on a page that takes credit cards. Everything works great except when the user goes back to place another order, IE/Firefox/etc. saved the form data and is displaying the credit card used previously. Is there a way to prevent a browser from storing (caching) certain fields so this doesn't happen?

I thought about generating a random value and using that as the field name but then I end up having to deal with things like card declines and new field names. Was hoping there was a simpler way...

thanks!

Hi..
Preferably try to make each and every of such pages secure by using ssl.. i.e. https... with this it will not save the form data... and everytime request a new data...

That's the funny thing, the site is SSL yet when i start to type in the field, a dropdown from the browser appears with other things typed in. Doing it for both IE and Firefox. I found AutoComplete="off" but this invalidates the HTML... I would think that if the site is SSL, it wouldn't save things...

It's a setting in the browser, and belongs to the user, not to the web developer. The user must set these values.

AutoComplete= is a nonstandard IE extension. This is why it won't validate.

Can you write empty strings into these fields with your script, before allowing the user to enter values?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.