Is it possible to restrict number value input?

Volker Kram created the topic: Is it possible to restrict number value input?

1 step:
"text input - number": it should not be allowed to use a "." - only digits from 0-9
possible?

2 step:
Input field "text input - number": i want only allow numbers between 1900 and 2015. Otherwise an error should be displayed.
Possible?

3 step:
I have an "single choice" with: option1 / option2 / option3
Input field number:
- on option1 only allow between 2008 and 2015
- on option2 only allow between 1900 and 1999
- on option3 only allow between 1900 and 2015
Possible?

#23853

Please Log in or Create an account to join the conversation.


Support replied the topic: Is it possible to restrict number value input?

Dear Volker,

You could write a custom javascript that would allow only numbers that satisfy certain rules.


Best regards,
Web-Dorado team


Joomla extensions ,
Wordpress plugins ,
Drupal modules
#23869

Please Log in or Create an account to join the conversation.


Volker Kram replied the topic: Is it possible to restrict number value input?

Do you have an example or can you make this for an additional fee?

#23874

Please Log in or Create an account to join the conversation.


Support replied the topic: Is it possible to restrict number value input?

Dear Volker,

Could you please contact us to [email protected] and let us to take a look at the issue? Please mention the full link to your forum post in your e-mail.
Thank you


Best regards,
Web-Dorado team


Joomla extensions ,
Wordpress plugins ,
Drupal modules
#23915

Please Log in or Create an account to join the conversation.


Volker Kram replied the topic: Is it possible to restrict number value input?

you remember - i bought the java-script from you and it worked fine.

But now it no longer works. Is there a problem with new joomla or new java or ...?
Example-Site: www.ergebnisliste.de/index.php/188
For example:
"Geburtsjahr (Jahrgang):*" = 1995
and
"Disziplin/ Wettbewerb:*" = 1.000 m Jugendlauf (2000-2007)
is not allowed

// Occurs before the form is loaded
function before_load()
{
var year= document.getElementById("wdform_8_element25"); 
year.addEventListener('keypress', function (evt) {
 if (evt.keyCode == 46) { evt.preventDefault(); return false; } });
jQuery("input[name=wdform_6_element25]").change(function(){
var selected = jQuery(this).attr('id');
if( jQuery("input[name=wdform_8_element25]").val() != "4 digits, for example: 1964"){
   var year_val = jQuery("input[name=wdform_8_element25]").val();
   if(selected == 'wdform_6_element253'){   
      if(year_val ** 2000 || year_val > 2007){
      alert("Fehler - in dieser Disziplin sind nur die Jahrgänge 2000 bis 2007 zulässig!");
      jQuery(this).prop('checked', false);
      }
   } else { 
................................
 jQuery("input[name=wdform_8_element25]").focusout(function(){
var changed_year_val = jQuery("input[name=wdform_8_element25]").val();
var radio_val = jQuery("input[name=wdform_6_element25]");
var checked_id = radio_val.index(radio_val.filter(':checked'));
if(checked_id != '-1') {
  if(checked_id == 3){
          if(changed_year_val ** 2000 || changed_year_val > 2007){     
              alert("Fehler - in dieser Disziplin sind nur die Jahrgänge 2000 bis 2007 zulässig!");
               jQuery("input[name=wdform_6_element25]").prop('checked', false);
          }
    }
................................

#31095

Please Log in or Create an account to join the conversation.


Support replied the topic: Is it possible to restrict number value input?

Dear Volker,

Could you please contact us to [email protected] and give temporary admin access to your website? We'll take a look and provide a solution to the problem as soon as possible.

Also mention the full link to your forum post in the subject of your e-mail.
Thank you.


Best regards,
Web-Dorado team


Joomla extensions ,
Wordpress plugins ,
Drupal modules
#31121

Please Log in or Create an account to join the conversation.


Volker Kram replied the topic: Is it possible to restrict number value input?

I work succesfully with these Script since last year.
Only one problem i still have: some users bypass the script - they don´t put in the "year of birth" (1964 par example), they put in the whole birthday (01.01.1964) and so the script doesn´t work.

Can i use the "Additional Attributes" to only allow a number with 4 digits?

#53279

Please Log in or Create an account to join the conversation.


Agapi G. replied the topic: Is it possible to restrict number value input?

Dear Volker,

This is surely possible! Please add maxlength attribute to your form field and you will achieve this functionality. Here's what you will need to do.

Edit your form field and scroll down to Additional Attributes option. Click on the small [+] button and define elements as follows:

Name: Maxlength
Value: 4


Let me know if it works.
Thank you!


Kind regards,
Agapi G.
Web-Dorado team
#53295

Please Log in or Create an account to join the conversation.


Volker Kram replied the topic: Is it possible to restrict number value input?

It works - thank you.

Where can i find a list with all Attributes, which can be used?

#53345

Please Log in or Create an account to join the conversation.


Agapi G. replied the topic: Is it possible to restrict number value input?

Dear Volker,

You should be able to use all HTML attributes (except ID and class) in Additional Attributes. However, in case you will face problems with any of them, please make sure to let us know.

Thank you!


Kind regards,
Agapi G.
Web-Dorado team
#53365
The following user(s) said Thank You: Volker Kram

Please Log in or Create an account to join the conversation.


Time to create page: 0.227 seconds
Powered by Kunena Forum

WORLD-CLASS SUPPORT

We are here for you every step of the way. Turn to our support with any questions you might have about our products and services. Our experienced customer care team is available to help you as fast as we possibly can.

Contact us