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

Listbox OnChange Problem

Status
Not open for further replies.

slr22

MIS
Jun 26, 2002
80
US
I am working with a web page where a user enters in information into a form. When the user enters the page it does a recordset.addrecord. The user has to type in some information and then there is a spot where based on what the user selects in a Listbox it shows them more information that they need to fill in. When they choose something in the listbox I fire the onchange command to figure out if they selected X or Y. When the user is all done typing in all the information they hit a submit button and it does a recordset.updaterecord.

When my page fires the onchange event it puts the data into the first line of the table and overrides the previously stored information that was in that line. Is there a way I can do this and add the record instead of overriding a record?

Here is some of my code to help explain a little bit more to what I'm trying to accomplish.

<SCRIPT RUNAT=Server LANGUAGE=JavaScript>
function thisPage_onenter() {

if (thisPage.firstEntered)
{
Recordset1.addRecord();

}
}
</script>

<SCRIPT ID=serverEventHandlersVBS LANGUAGE=vbscript RUNAT=Server>
Sub btnSubmit_onclick()
txtDomeType.value = LstDomeType.getValue( LstDomeType.selectedIndex)


Recordset1.updateRecord
Response.Redirect (&quot;MainMenu.asp&quot;)

End Sub

Sub LstType_onchange()
txtType.value = LstType.getValue (LstType.selectedIndex)
if txtType.value = &quot;Flat&quot; then
LstFlat.show
LblFlat.show
else
do something else
end if
end sub
</script>

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top