
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 03:17 AM
Hi All,
I have to validate whether user has added an attachment or not before allowing him to submit a request.Please help me if any of you have done a similar kind of implementation.
Regards,
Kirti
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 04:59 AM
Write the below on submit script
function onSubmit() {
var attachmentList = gel("header_attachment_list_label");
if (attachmentList)
{
if (attachmentList.style.visibility == "hidden" || attachmentList.style.display == "none")
{
alert("Please attach the required file.");
return false;
}
}
}
Regards,
Harish.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 05:21 AM
Yes i checked in demo.its working fine But Iam confused now..which approcah is better
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 05:30 AM
that's upto you there will be always number of solution for every problem.... pick one that suits you
gel solution is simple. Will work now .. but would it work in future ? am afraid nobody could answer that... might work or might not...
querying the attachment table > will work now and always ... But you need to script a bit
so you need to decide which path to take

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 05:57 AM
Thank you. I will keep this in mind ..For now Iam not using that validation as i felt i can validate whether he is attaching a doc but i wont be able to validate if he is attaching a meaningful required file..:)