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

Make the answer correct . Your welcome.


if you are okay with the solution that's alright ...



But just a caution , gel is not recommended by service now .... might work now but might not work later once you upgrade your instance ...



decision is your's to take


Community Alums
Not applicable

Hi Kalaiarasan,



Oh so this doesnt work in Eureka well in that case i should avoid this.



Thanx for cautioning me


should work in Eureka ... i was referring upcoming version's ...



check once on demo if your instance isn't on Eureka


Hi Kalai,



                          im using Dublin it works for me.


Regards,


Harish.