Support

  1. Magnus.singer
  2. General
  3. Sunday, May 13 2018, 10:27 PM
  4.  Subscribe via email
Hello there,
I have a little problem: I have a url field where the user has to enter his Facebook Profile Link. This field has the placeholder 'facebook.com/'. The default behavior of a url field is to add only 'http://' when it's necessary, but I want that it adds 'https://facebook.com/' when it's necessary. Is this possible and if it is, how can I do this? Big thanks in advance,
Magnus
admin Accepted Answer
Admin
Hi,
sorry for late reply, you can do it with a javascript code, but to help you better I need some other information.

For example if a user add something like http://www.google.it then you will have https://facebook.com/www.google.it :o
  1. one week ago
  2. General
  3. # 1
Magnus.singer Accepted Answer
Pro
Hello,
I have thought about a JavaScript solution too but then I have the problem you’ve mentioned above. So I decided to search for alternatives and thought about optimizing the default behavior, because this works perfectly. For example if I just enter google.com it adds the http://, but if I enter https://google.com, it does nothing, and this is exactly what I want. Is it possible to optimize the default behavior or do I need js? Regards,
Magnus
  1. one week ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
sorry but I does not understood.

if I just enter google.com it adds the http://, but if I enter https://google.com, it does nothing
It is already so.
Is it possible to optimize the default behavior or do I need js?
what kind of optimizations are you thinking?
  1. one week ago
  2. General
  3. # 3
Magnus.singer Accepted Answer
Pro
Ok sorry my fault I try to explain it more clearer: let’s say I have the Facebook profile url https://facebook.com/test, if I want to add this URL to my page, I want to have the following options:

1.: just normal copy & Paste with nothing special
2.: here comes my problem: if I just enter test the text field adds https://facebook.com/ by itself, just like it does already with http://

I hope this helps
  1. one week ago
  2. General
  3. # 4
admin Accepted Answer
Admin
Hi,
try to add following Javascript code to your template:
jQuery(document).ready(function($){
$('input[type="url"]').unbind('blur').blur(function(){
var value=$(this).val();
if(value!='' && value.indexOf('http://')<0 && value.indexOf('https://')<0) $(this).val('https://facebook.com/'+value);
});
});
  1. one week ago
  2. General
  3. # 5
Magnus.singer Accepted Answer
Pro
Thank you very much now it works! Great support and even greater products, keep on going like that!
Greetings,
Magnus
  1. one week ago
  2. General
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.