G
Guest
I have this scenario (simplified)
function addnewdata () {
check for partial match already in db for information entered by user
if (partialmatch succeeds) {
open new window aspx page (using javascript) with a datagrid of these
partial match records (by doing a sqlcommand using some query string values
taken from opener data entered)
***
}
else
{
no partial matches already so do an insert of new data entered
}
}
at the point I have put *** - this is a new little window - it shows some
records. The user may hit SELECT for a given record. If they do, I have some
code which runs, inserts into the db, refreshes the opener screen and the
page is refreshed with this record which works fine. If they hit CANCEL they
have decided that they do not want to use a partial record and want to
proceed with the data entered. My question: If they hit cancel, how do I
then get into the ELSE clause of this function ??? Currently my cancel just
has javascript self.close in it. The window dissapears and the original data
entered is sitting there in the opener page, but i cannot figure out how to
say, ok now go and insert this data ! Do I have to use return false;
somewhere? not sure where. I thought about creating a new function to insert
a data if the user has hit cancel but dont know how to test that the user has
hit cancel in this window then run some server code. Real head block ( any
help appreciated. many thanks. Lou.
function addnewdata () {
check for partial match already in db for information entered by user
if (partialmatch succeeds) {
open new window aspx page (using javascript) with a datagrid of these
partial match records (by doing a sqlcommand using some query string values
taken from opener data entered)
***
}
else
{
no partial matches already so do an insert of new data entered
}
}
at the point I have put *** - this is a new little window - it shows some
records. The user may hit SELECT for a given record. If they do, I have some
code which runs, inserts into the db, refreshes the opener screen and the
page is refreshed with this record which works fine. If they hit CANCEL they
have decided that they do not want to use a partial record and want to
proceed with the data entered. My question: If they hit cancel, how do I
then get into the ELSE clause of this function ??? Currently my cancel just
has javascript self.close in it. The window dissapears and the original data
entered is sitting there in the opener page, but i cannot figure out how to
say, ok now go and insert this data ! Do I have to use return false;
somewhere? not sure where. I thought about creating a new function to insert
a data if the user has hit cancel but dont know how to test that the user has
hit cancel in this window then run some server code. Real head block ( any
help appreciated. many thanks. Lou.