you have an error in your code, there is one closing bracket too much
change
if (document.form['form']['name'].value != "" &&
document.form['form']['city'].value != "" )) {
to
if (document.form['form']['name'].value != "" &&
document.form['form']['city'].value != "" ) {
1
solved Javascript – verify empty inputs