How to link client script to web form?

Hi all,

I created a doctype and wrote some validations, it works fine .
But my issue is, I created web form with that doctype but validations not working on web form.

Please give me some solution, how to link client script to webform

You can add client script for webform check the docs

Thank You, But I want to add client script file to web form is there any way

what do you mean by adding a client script file to web form?

I Created a doctype and I wrote client script also.
when I create a web form with same doctype, web form created but script validations not applying.

The main objective of the webform is to get data from the guest user through the form.
It is not a better-looking version of our desk form.

But still, if you need some customization you can add in the web form through the custom script but the doctypes custom script will not work.

Ok thank you.

how can i add validation to field at doctype when submitting the form?

You can add a validation script for fields in the web form which will trigger when you save the form.
Check the documentation here Customization

If you need to add a validation script at the doctype level then you have to add a client script.

I have created Web form on one doctype it is creating document of that doctype after saving web form. I have added some functionality on that doctype but on_submit event in server script that script is having opening file so when i am attaching the doc in web form then it is not getting because after save it will store in directory then we can access it in on_submit how i can solve this saving file before clicking on save button of web form if it works then directly i can change server script function to after_save from on_submit then it will get that file