new form vs edit form

rss

Posted by coresoul - Mar 30 ’15 at 12:43

i have working validation js for newform. i try to copy same js for edit form but didnot work? is there a difference?

below is my code.

fd.onsubmit(function() {

if(!fd.field('Title').value().trim()) {

alert('Please, fill in the Project Name field.');

$('.projectname input').focus();

return false;

}

else if(!fd.field('Asset_x0020_ID_x0020_Numbers').value().trim()) {

alert('Please, fill in the Asset ID Numbers field.');

$('.assetid input').focus();

return false;

}

else if (fd.field('Project_x0020_Manager').value().dictionaryEntries.length == 0) {

alert('Please, fill in the Project Manager field.');

return false;

}

else if(!fd.field('AFH_x0020_Type').value()) {

alert('Please, select in the AFH Type field.');

return false;

}

else if(!fd.field('StartDate').value()){

alert('Please, fill the start Date.');

$('.startdate input').focus();

return false;

}

else if(!fd.field('Completion_x0020_Date').value()){

alert('Please, fill the Completion Date.');

$('.compdate input').focus();

return false;

}

else if(!fd.field('Related_x0020_Information').value()) {

alert('Please, fill in the related information field.');

$('.relatedinfo textarea').focus();

return false;

}

else if(!fd.field('Basic_x0020_Description').value()) {

alert('Please, fill in the basic information field.');

$('.basicdesc textarea').focus();

return false;

}

else if(!fd.field('MOC_x0020_Number').value()) {

alert('Please, fill in MOC Number field.');

$('.moc input').focus();

return false;

}

else if(!fd.field('Justification').value()){

alert('Please, fill the justification field.');

$('.just input').focus();

return false;

}

return true;

});

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 10 months 26 days
    #1 by Dmitry Kozlov Mar 30 ’15 at 10:24

    There are no differences in working with new and edit forms. So, make sure that you've assigned the CSS-classes that you use in your code e.g. projectname, assetid etc to the appropriate fields. Also, open the browser console and check whether JS-errors or notifications appear there when you submit the form.

Displaying 1 to 1 of 1 messages