Jump to content

Autofill e-mail and telephone fields


Dennis Rusch

Recommended Posts

How can I fill the 'name' property (of the editfield on the webpage) of an TUniEdit field so the autofill knows what content to put in it.
When using the FieldLabel property of the TUniEdit the 'name' property is filled with that value. But as I cannot use the FieldLabel property for this puprose I would like to fill the 'name' property myself. But I cannot seem to find a way.

When I use the 'Telephone' as a value for the FieldLabel, the name of the edit control on the form will be 'Telephone:' and the webbrowser will fill in the telephone number if present.

How can this be done?

 

Regards,

Dennis

  • Upvote 1
Link to comment
Share on other sites

Thank you for your reply.

I am using version 1.90.0.1541 and the desktop edition.


I am not trying to fill the edit field, but I am trying to alter the 'name' property of the field on the webform (in the browser). That name property is what the browser uses to auto fill the corrrect value into the editfield. Normally the 'name' property is empty, but when I use the FieldLabel property of the TUniEdit the 'name' property in the browser will contain the value of the FieldLabel property as set in the TUniEdit.

I would like to fill the 'name' property without using a FieldLabel. Is this possible?

 

Regards,

Dennis
 

Link to comment
Share on other sites

2 hours ago, Dennis Rusch said:

How can I fill the 'name' property (of the editfield on the webpage) of an TUniEdit field so the autofill knows what content to put in it.
When using the FieldLabel property of the TUniEdit the 'name' property is filled with that value. But as I cannot use the FieldLabel property for this puprose I would like to fill the 'name' property myself. But I cannot seem to find a way.

When I use the 'Telephone' as a value for the FieldLabel, the name of the edit control on the form will be 'Telephone:' and the webbrowser will fill in the telephone number if present.

Please explain in more detail.

Link to comment
Share on other sites

An Edit field on a form on a website has a 'name' property. This name property is used by the browser to determine what kind of information it contains. And therefore it knows what information from an address should go in which edit field (using auto fill). 

When I specify a TUniEdit.FieldLabel (e.g. telephone) with the TUniEdit UNIGUI copies this value in the 'name' property of the edit field on the webform. And now the browser knows that it should fill in the telephone number at that field when the user chooses to auto-fill the form with his contact information.

I would like to fill this 'name' property without using the TUniEdit.FieldLabel.

I've added two screenshots with the resulting form-editfield. One without the TUNIEdit.FieldLabel filled and one with the TUniEdit.FieldLabel filled with 'Telephone'.

Schermafbeelding 2020-12-18 122428.png

Schermafbeelding 2020-12-18 122003.png

Link to comment
Share on other sites

 

 

// for mobile TunimEdit - painted

function painted(sender, eOpts)
{
  var me = sender.inputElement;
  //console.log(sender);
  me.dom.setAttribute('autocomplete', 'tel');
  me.dom.setAttribute('name', 'tel-local');
}

// for desktop TuniEdit - afterrender
function afterrender(sender, eOpts)
{
  var me = sender.inputEl;
  me.el.dom.setAttribute('autocomplete', 'tel');
  me.el.dom.setAttribute('name', 'tel-local');
}

 

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

http://forums.unigui.com/index.php?/topic/9634-autofill-how-to-turn-off/&do=findComment&comment=86104

http://forums.unigui.com/index.php?/topic/15681-автозаполнение-запоминание-ранее-введенных-значений/&do=findComment&comment=86046

 

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...