Hello!
How can I add commas to the price input field while I am typing the price range in the search form? ie.: $10,000,000
Thanks!
Printable View
Hello!
How can I add commas to the price input field while I am typing the price range in the search form? ie.: $10,000,000
Thanks!
me too wanting to know this. Is this achievable
How can we implement something like this:
http://jsfiddle.net/2LAcj/
Or another method to accomplish the same result?
so I guess its not possible then?
I also found this code here it might give some idea how to implement this:
http://jsfiddle.net/yWTLk/348/
Hello All,
Upload file price format to js files and connect it.
And also add this code:
save and check it.Code:Only registered members can view the code.
Hi Viktor,
Thank you for getting back to us. I have uploaded the file and called it by adding the code in header.tpl of my template folder:
I also added your code in footer.tpl of my template before the </body>Quote:
<script type="text/javascript" src="{$rlTplBase}js/price_format.js"></script>
I saved and check but nothing happened. Did i do something wrong?Quote:
<script type="text/javascript">
{literal}
$(document).ready(function(){
$('#field_id').priceFormat({
prefix: '',
thousandsSeparator: ',',
limit: false,
centsLimit: 0,
centsSeparator: ''
});
})
{/literal}
</script>
Because you should set original field id instead of: field_id
Hi Viktor,
I have changed the following code in footer.tpl, but still no effect.
Also tried this:Quote:
<script type="text/javascript">
{literal}
$(document).ready(function(){
$('price').priceFormat({
prefix: '',
thousandsSeparator: ',',
limit: false,
centsLimit: 0,
centsSeparator: ''
});
})
{/literal}
</script>
Quote:
<script type="text/javascript">
{literal}
$(document).ready(function(){
$('#price').priceFormat({
prefix: '',
thousandsSeparator: ',',
limit: false,
centsLimit: 0,
centsSeparator: ''
});
})
{/literal}
</script>
Hello Wei Hong,
Are you sure with id for your price field? Is it 'price'?
try to use:
because your price field doesn't have any ids.Code:Only registered members can view the code.
I tried to replace with your suggest coded too but it still doesnt work. I check using inspect element and it shows the id of the price listing field is "sf_field_price" so I changed using the code
But it still doesnt workQuote:
<script type="text/javascript">
{literal}
$(document).ready(function(){
$('#sf_field_price').priceFormat({
prefix: '',
thousandsSeparator: ',',
limit: false,
centsLimit: 0,
centsSeparator: ''
});
})
{/literal}
</script>
Would you please send me page where do you want it. I will check and try to solve it.
Thanks Viktor, message sent
Hello Wei Hong,
I found 2 errors with it:
1. You should move <script src="your_site/scripts/tiengViet.js"></script><script>tiengViet.method=4; tiengViet.displayMode = 1</script>
<script type="text/javascript" src="your_site/templates/FiLORSP/js/price_format.js"></script>
40 lines below.
Then use this code:
save and check again.Code:Only registered members can view the code.
thanks Viktor, it works great now. But I notice that I cant no longer input cent. For example: $1.99 or $2.50. Only $199 or $250. I then went back to the example that I posted earlier and they are also can't input cent. Is there anyway that I can fix it?
Also is there anyway if I can add this effect to the search box in search page as well?
Hello Wei Hong,
Please see in js code line: centsLimit: 0,
set 2 and try again.
Helloو
I have several fields of price type.
I used the codes as follows, but did not work.
1) Uploaded the price_format.js in js folder in my template
2) I added below code in footer.tpl of my template before the </body>
3) And also adding this code in header.tpl of my template folder( in line 58 before {rlHook name='tplHeaderCommon'}):PHP Code:
Only registered members can view the code.
please guide me.PHP Code:
Only registered members can view the code.
Hi Mousa,
let me see it here, please wait
First step:
PHP Code:
Only registered members can view the code.
I'm using jquery_number.js, do you want to use it? if the answer is yes I'll leave it here attached. I am waiting...
First step:
Second step:PHP Code:
Only registered members can view the code.
Below the line:PHP Code:
Only registered members can view the code.
add the line:PHP Code:
Only registered members can view the code.
PHP Code:
Only registered members can view the code.
Read the post above, in a while I am going to post the Third step (3), please wait ...
Third step:
With the "step_form.tpl" file opened, locate the code:
Add below the line: hashTabs();PHP Code:
Only registered members can view the code.
The end result should be this:PHP Code:
Only registered members can view the code.
Save and close.PHP Code:
Only registered members can view the code.
I'm going to post Fourth step(4) in a moment ...
Fourth step:
On your site open the file:
below the line:PHP Code:
Only registered members can view the code.
edit the line:PHP Code:
Only registered members can view the code.
you just need to replace class="numeric"PHP Code:
Only registered members can view the code.
per ...
id="price"
The end result is:
Save and clear your browser's cache and see if it's working.PHP Code:
Only registered members can view the code.
Reread what I posted above because some things have been updated!
In my script the price setting looks like this:
5.000,00 (five thousand)
5.700,00 (five thousand and seven hundred)
but you can change the configuration through the line:
PHP Code:
Only registered members can view the code.
Documentation, demos and download:
https://www.customd.com/articles/14/...r-format-redux
https://github.com/customd/jquery-number
Thanks
Thanks Ed, did it messup with your saved search criteria? I notice that when I look at my alert page, which show my saved search criteria, the price show two ',,' like 2,,000 or xx,,xxx, xx is just number. Everything else works fine.
Hello,
Thanks Ed very much for your complete description and guidance.
Your method worked, but I have two problems:
1) I do not need a cent separator, with the change this code
toPHP Code:
Only registered members can view the code.
still separates two digits.PHP Code:
Only registered members can view the code.
2) I have some type of price field that works only for the main case where the key is price, for other items that do not work the price1 key, price2, and so on.
I would like the price of 123456789 to be typed as 123,456,789 without cent separator.
Thanks, if these tips are resolved.
Hello Mousa,
For other price fields try to use this code:
Code:Only registered members can view the code.
Thanks Viktor,
It works well now
How to enable this feature for search boxes?
I did not work your code in the search files.
Hello Wei and Mousa,
Instead of "id" you can use "class" example:
orPHP Code:
Only registered members can view the code.
orPHP Code:
Only registered members can view the code.
if are class you should assign the class to the tag, example:PHP Code:
Only registered members can view the code.
I suggest reading the script documentation:PHP Code:
Only registered members can view the code.
https://www.customd.com/articles/14/...r-format-redux
and
https://github.com/teamdf/jquery-number
I prefer use dropdown menu in price fields.
see on my website:
www.sitecar.com.br
Thanks
hello,
Thanks Ed,
Please guidance how to use the drop down menu in price fields (at the MAX and Min) same your site.
Hello Wei,
You need to repeat the procedure I posted, in the other pages, search, saved searches, etc ... to see if everything is right, check the source code of the page, see if the script is linked.
Hello Wei
I'm using Dropdown / Select for the price fields in search, I'll even explain here in the forum how to make that change.
But just find the correct file and load the JavaScript that will probably work, I'll try to do this here in my testings environment, however can take a while, can be?
Hi Mousa,
I posted an article showing how to change the price field for menu, see the links below:
http://forum.flynax.com/showthread.p...opDown-(4-6-2)
and
http://forum.flynax.com/showthread.p...-search-engine
Thanks