Read-only attribute on form field



Posted Dec 30, 2022

Hello, I have a form in zendesk in which I only have access to call from an Angular 9 application, the code started with asking me to fill in the form fields with default values such as name and email, but now they ask me to fill in certain fields cannot be modified, they come from the database and autocomplete themselves as in the following code:

  cargarFormulario(nombre_completo,email,telefono,dni,calle){
    this.s.type = "text/javascript";
    this.s.id = "ze-snippet";
    this.s.src = "XXX";
    this.s.text = "";

    this.renderer2.appendChild(this.document.body, this.s);
   
    window["zESettings"] = {
      webWidget: {
        "launcher":{
            "label": {
            "*": "Preguntas"
          }
        },
        contactForm: {
          fields: [
            { id: 'name', prefill: { '*': nombre_completo } },
            { id: 'email', prefill: { '*': email } },
            { id: '6830440748752', prefill: { '*': telefono }, readonly : true }, // Example
            { id: '6830122312181', prefill: { '*':  calle} }
          ]
        }
      }
    };

  }

The problem is that I can't find how to make a field read-only in the zendesk documentation.

How can I achieve the read-only effect?


0

0

0 comments

Sign in to leave a comment.

Didn't find what you're looking for?

New post