nextval is a sequence manipulation function--very similar to currval (returns the current highest value), except it returns the NEXT value that would be used...and it also increments the sequence.....ie...
lets say I have a table with a PK sequence of 1,2,3,4,5...I do a select nextval(fieldname) and it will return 6--and increment the sequence.so it I run the script again, I will get 7 etc....
make sense?
so I have page 1, gets my nextval--adds it to the form as a hidden field. if the user hits submit--form processes, clears out etc...no chance for dupes, unless they hit back, or refresh...but since the nextval is already calculated, and taken...it will not allow the dupe to be entered....just be sure you catch the error...