can i override the add new button and insert any code before the record gets added ?

also can i lock editing in forms ?