PDA

View Full Version : when user hits cancel get the old value


ksridhar69
11-04-2002, 03:57 PM
Here is a drop down, when they change the value and hit OK form is submitting perfectly. If they hit cancel user wants old drop down value

counter = 0;
function Changethepatientidinthispage()
{


counter ++;

if (counter > 1)
{
if (confirm("Do you want to Change The patient ID"))
{

window.document.patientidchage.action = "test.asp"
window.document.patientidchage.submit();
}
}

}

<select name="patient_id_code" size="1" onblur="Changethepatientidinthispage();">

<option value = "01">01-CLAIM NUMBER</option>

<option value = "02">02-POLICY NUMBER</option>

<option value = "03">03-SSN</option>

<option value = "04">04-FILE NUMBER</option>

<option value = "05">05-CASE NUMBER</option>

<option value = "06">06-PROVIDER #</option>

<option value = "07">07-GROUP NUMBER</option>

<option value = "10">10-PLAN NUMBER</option>

<option value = "12">12-OTHER</option>

<option value = "14">14-DOB</option>
</select>

krycek
11-04-2002, 04:37 PM
just a thought...

every time the selection is changed, try updating two variables which will store the 'history' ;)

e.g. currentItem and previousItem

on the change, make lastItem = currentItem and currentItem = the new selection.

Then, in your code for cancelling, you can set the selection of the drop-down to be lastItem.

I do not know if this is the best way of acheiving your goal, but it is the only way I could think of. :)

Good luck!

::] krycek [::