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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript fills second field. Info lost if user goes "Back" 1

Status
Not open for further replies.

DuncanKing

Programmer
Jan 14, 2004
32
IE
I have field in a form that is filled depending on the option that a user selects from the previous field.

Eg "Model" is filled with all the Models available if a user selects a particular "Make."
This works well.

Here the code I have:
<select name="Make" onChange="fillSelectFromArray(this.form.Model, ((this.selectedIndex == -1) ? null : modelinfo[this.selectedIndex-1]));">

After the user has filled out the form and clicks "Next" it brings them to a page that lets them review the information entered. If they agree they press "Submit" and the information is entered into the DB. However, if they want to change something and go back to the previous page to change information on the form, the filled information in the second field disappears. Is there a piece of code that will keep the information that was in the "filled field"?

The code I have for "go back" is

<form>
<input type="button" value="Back to Previous Page"
onClick="javascript: history.go(-1)">
</form>

Thanks all...

 
P.S., I'm sure it's on your list of things to do, but don't forget to thank theniteowl with a star if, as you say, his contribution to your work was "Brilliant!" He got you to a working solution through nine posts over a 8-and-a-half hour period.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 


Yes absolutely.

I've done that and thanks for your contribution. I'll give it a try. ...the theniteowl soloution works really well.

Thanks
 

Off topic...but how do you get the indented "code" screen into the reply?
 
There are a lot of helpful tags you can use. They're like HTML, but with square brackets ([ ]) instead of angle brackets (< >).

You can see the whole list of tags available by clicking the "Process TGML" link beneath the field where you type posts (where I'm typing right now). A popup window will show you all that are available.

But, to answer your specific question. If you type:

[ignore]
Code:
This is my code
[/ignore]

You will get:

Code:
This is my code

There are a lot of emoticons/smileys available too! Click the Emoticons/Smileys link to get a pop-up of options available.

Have fun!

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top