First of all, please take the time to use proper spacing so that your code is readable and use the
code button in the editor. Otherwise, nobody will help you because your code is impossible to read. I just edited your post to reformat your code so it would be readable.
Your alert() calls will generate errors because that function only accepts 1 parameter, not 2. If you want a title in your error messages, you need to use
G.alert() in place of alert().
You need to run this code with your web browser's debugger enabled to see any errors. You have probably misspelled a field name. In Chrome and Firefox, press F12 to activate the debugger.
If you still can't figure it out, then post the complete xml code for the Dynaform.