deneesta
(Denis Starostachev)
April 18, 2016, 5:47am
1
Continuing the discussion from Is it possible to create an input mask for a phone number? :
The way it was done with one of my other sites, there was a js lines:
$(function(){
$("input[name='phone']").mask("+7(999) 999-99-99");
$('input[placeholder], textarea[placeholder]').placeholder();
});
So I tried this in my webflow project. In the full site package, in js folder there are 2 files modernizr.js and webflow.js. I tried adding these js lines in both files and also created a separate scripts.js. None of them worked in my forms.
So, are there any tips on that?
Where do I put jawa scripts if I need to?
Can I add a custom js code at all in webflow projects?
samliew
(webflowexpert.com)
April 18, 2016, 5:55am
2
Usually the recommended method to place jQuery code is in Page Settings > Footer Code, as you need jQuery to load before your custom script.
deneesta
(Denis Starostachev)
April 18, 2016, 6:01am
3
Thank you for help, but this didn’t work (
samliew
(webflowexpert.com)
April 18, 2016, 6:02am
4
You also need to wrap code in the “Footer Code” section with
<script>
</script>
Also, it seems like your other sites are using external jQuery plugins, which you need to import as well.
Specifically .mask()
and .placeholder()
functions.
deneesta
(Denis Starostachev)
April 18, 2016, 6:06am
5
Oh, this sounds a bit more complicated than I thought… ) So Webflow doesn’t have built in means for that sort of stuff?
samliew
(webflowexpert.com)
April 18, 2016, 6:10am
6
That is what the Custom Code field is there for - to allow web developers to implement such functionality.
deneesta
(Denis Starostachev)
April 18, 2016, 6:13am
7
Ok, thank you, I will try to sort this out
system
(system)
Closed
June 18, 2016, 2:47am
8
This topic was automatically closed after 60 days. New replies are no longer allowed.