How to check whether the user has added an attachment while requesting from catalog

Community Alums
Not applicable

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

1 ACCEPTED SOLUTION

Harish Murikina
Tera Guru

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.


View solution in original post

17 REPLIES 17

Community Alums
Not applicable

Hi Anurag,



Its on Catalog Item..As using Gliderecord is not prefereable client side..I felt harish's script would help to suffic this requirement.



However this also workd ::) tnx for response



Regards,


kirti


Kalaiarasan Pus
Giga Sage

something related but is server side script based ....



GlideRecord - ServiceNow Wiki


Community Alums
Not applicable

Thanks Kalairasan this helped me gain knowledge


Harish Murikina
Tera Guru

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.


Community Alums
Not applicable

Perfect tnx Harish