Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a way to turn off Auto Fill for users when filling out a form?
    primarykey
    data
    text
    <p>I think this is a quick one for you, Folks:</p> <p>I am collecting data in a UiApp built form, and using validation before enabling them to continue. My problem is that often auto-fill will have different format than what is required in my form (such as the state written out instead of a postal abbreviation). I think this may lead to confusion, so I would love to force the users to fill out each box by hand. </p> <p>Is there a way to turn off the auto-fill function of browsers? If I were to build in html, would it give me more control of this?</p> <p>Thanks for the help~ Martin</p> <p>NOTE: I am using the "ChangeHandler" as it will at least update the validator when autofill is used. </p> <p>Here's an example code which is of the style I am using. It includes multiple field validation and a review panel. Relevant to my question, but also may be useful for those building forms. </p> <pre><code>function doGet(e){ var app = UiApp.createApplication().setTitle("Review and Validation"); var appPanel = app.createVerticalPanel(); var form = app.createFormPanel(); var panel1 = app.createGrid(4,5).setId('panel1'); var firstNameLabel = app.createLabel("First Name:"); var firstName = app.createTextBox().setName('firstName').setId('firstName'); var lastNameLabel = app.createLabel("Last Name:"); var lastName = app.createTextBox().setName('lastName').setId('lastName'); var emailLabel = app.createLabel('Your Email'); var email = app.createTextBox().setName('email').setId('email'); var button1 = app.createButton('Go to Review').setEnabled(false); var info1 = app.createLabel("Please Enter First Name") .setVisible(false) .setStyleAttribute('color', 'red'); var info2 = app.createLabel("Please Enter Last Name") .setVisible(false) .setStyleAttribute('color', 'red'); var info3 = app.createLabel("Please Enter Email") .setVisible(false) .setStyleAttribute('color', 'red'); var syncChangeHandler = app.createServerHandler('syncText').addCallbackElement(form) .validateLength(firstName, 2, 30).validateLength(lastName, 2, 30).validateEmail(email); var onValidInput = app.createClientHandler().validateLength(firstName,2,30).validateLength(lastName,2,30).validateEmail(email).forTargets( button1).setEnabled(true); var onInvalidInput1 = app.createClientHandler().validateNotLength(firstName, 2, 30).forTargets(button1).setEnabled(false).forTargets(info1).setVisible(true); var onValidInput1 = app.createClientHandler().validateLength(firstName, 2, 30).forTargets(info1).setVisible(false); var onInvalidInput2 = app.createClientHandler().validateNotLength(lastName, 2, 30).forTargets(button1).setEnabled(false).forTargets(info2).setVisible(true); var onValidInput2 = app.createClientHandler().validateLength(lastName, 2, 30).forTargets(info2).setVisible(false); var onInvalidInput3 = app.createClientHandler().validateNotEmail(email).forTargets(button1).setEnabled(false).forTargets(info3).setVisible(true); var onValidInput3 = app.createClientHandler().validateEmail(email).forTargets(info3).setVisible(false); firstName.addChangeHandler(onInvalidInput1); firstName.addChangeHandler(onValidInput1); lastName.addChangeHandler(onInvalidInput2); lastName.addChangeHandler(onValidInput2); email.addChangeHandler(onInvalidInput3); email.addChangeHandler(onValidInput3); firstName.addChangeHandler(onValidInput); lastName.addChangeHandler(onValidInput); email.addChangeHandler(onValidInput); panel1.setWidget(0,0, firstNameLabel); panel1.setWidget(0,1, firstName); panel1.setWidget(0,2, lastNameLabel); panel1.setWidget(0,3, lastName); panel1.setWidget(1,1, info1); panel1.setWidget(1,3, info2); panel1.setWidget(2,0, emailLabel); panel1.setWidget(2,1, email); panel1.setWidget(2,3, button1); panel1.setWidget(3,1, info3); app.add(form); appPanel.add(panel1); form.add(appPanel); var panel2 = app.createGrid(4,5).setId('panel2').setVisible(false); var reviewFirstNameLabel = app.createLabel("First Name:"); var reviewFirstName = app.createLabel().setId('reviewFirstName'); var reviewLastNameLabel = app.createLabel("Last Name:"); var reviewLastName = app.createLabel().setId('reviewLastName'); var reviewEmailLabel = app.createLabel('Your Email:'); var reviewEmail = app.createLabel().setId('reviewEmail'); var submitButton = app.createSubmitButton('Submit'); var button2 = app.createButton('Edit Response'); panel2.setWidget(0,0, reviewFirstNameLabel); panel2.setWidget(0,1, reviewFirstName); panel2.setWidget(0,2, reviewLastNameLabel); panel2.setWidget(0,3, reviewLastName); panel2.setWidget(1,0, reviewEmailLabel); panel2.setWidget(1,1, reviewEmail); panel2.setWidget(2,0, button2); panel2.setWidget(3,0, submitButton); appPanel.add(panel2); // var editResponse = app.createClientHandler() .forTargets(panel1).setVisible(true) .forTargets(panel2).setVisible(false); button1.addClickHandler(syncChangeHandler); button2.addClickHandler(editResponse); return app; } function syncText(e){ var app = UiApp.getActiveApplication(); app.getElementById('reviewFirstName').setText(e.parameter.firstName); app.getElementById('reviewLastName').setText(e.parameter.lastName); app.getElementById('reviewEmail').setText(e.parameter.email); app.getElementById('panel1').setVisible(false); app.getElementById('panel2').setVisible(true); return app; } function doPost(e){ var ss = SpreadsheetApp.openById('0Aiapuj1KtAujdHYzZzNzMEsxMUtranZhaXhiSFFnanc').getSheets()[0]; var range = ss.getRange(ss.getLastRow()+1, 1, 1,4); var values = [[new Date(),e.parameter.firstName, e.parameter.lastName, e.parameter.email]]; range.setValues(values); var app = UiApp.getActiveApplication(); var label = app.createLabel('Thank You!'); app.add(label); return app; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload