Text field with dashes

business

Member
I tried using custom_functions.js but getting error while trying the example function:

[pre]
index.php?function=show_insert_form&tablename=employee:1300 Uncaught ReferenceError: dadabik_helloworld is not defined
at HTMLInputElement.onblur (index.php?function=show_insert_form&tablename=employee:1300)
onblur @ index.php?function=show_insert_form&tablename=employee:1300
[/pre]


I am using onblur:dadabik_helloworld

and function is the example function:
[pre]
function dadabik_helloworld()
{
alert('Hello DaDaBIK user!');
}
[/pre]


[pre]
You are using DaDaBIK version 9.2.1-Monterosso enterprise, installed on 01-19-2019 (installation code: 0), the latest version of DaDaBIK is 9.2.1-Monterosso released on 12-19-2018

You are runnning the last release of DaDaBIK

PHP Version: 7.2.14

mysql version: 5.6.40-84.0-log

Web server: Apache

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
[/pre]
 

eugenio

Administrator
Staff member
If your installation was the result of a prepackaged app installation, the files you have to edit are include/custom_functions_prepackaged_app.js and include/custom_functions_prepackaged_app.php
I guess that's the problem.

Best,
 

business

Member
No, I haven't used any prepackaged app.

I am not sure why but I am facing too many bugs with this version (as per my last few posts).

Do you have any other version (may be a bit older) that I can download and test it on a new site?

Thanks
 

eugenio

Administrator
Staff member
Hello,
the latest version surely has less bugs respect to the older ones.

I don't think we have officially detected any bug according to your posts, so far. Which bugs, in particular, are you referring to?

About this issue: do you have a file called custom_functions_prepackaged_app.js in your include folder?

Best,
 

business

Member
Hi,

I don't have any file inside include folder named: custom_functions_prepackaged_app.js

Here are the bugs/issues I am referring to:
1. PDF Reports/Graphs not working:
https://dadabik.com/forum/read.php?1,21101

2. Record Error (random):
https://dadabik.com/forum/read.php?1,21190

3. Custom function not working:
Current post.

I want to know what login details do you want, so i can create a support ticket so you can help me get these issues solved?

Thank you
 

eugenio

Administrator
Staff member
Hello,
1) and 2) have not been classified as bug :)

1) As I said, you can open an email support ticket and we'll look at it to understand what happened (support@dadabik.org), I can't say much without looking into the application

2) I need the error message (debug_mode 1), without the error message I can't do anything

About this post, it's very strange the function you wrote is not recognized; the only reason I can think (without looking at the actual files/configuration) is a mistake in custom_functions.js that prevents the correct parsing. Even in this case, you can open an email support ticket and we'll give you all the instructions.

Best,
 

business

Member
Hi,

Is there any sample code to update value of input box via javascript using onkeyup function?

https://cl.ly/774a0e30ba2f

For eg: when I enter anything it should add a hyphen to it?

I have tried many methods available online, but none works:
[pre]
/*
function dadabik_social_security(field) {
//alert(field.value);
//$("label[for='ss_number']").text(field.value);
var els=document.getElementsByName("total_numofallowance");
//alert(els);
//if (els.length>3)
els.text = "yourDesiredValueHere";
//let ele = $("input[name=ss_number]").val();
//ele = ele.value.split('-').join(''); // Remove dash (-) if mistakenly entered.

//let finalVal = ele.match(/.{1,3}/g).join('-');
//$("input[name=ss_number]").val = finalVal;
//$("input[name=ss_number]").attr("value","HI Value Change");

//$( "input[value='Hot Fuzz']" ).next().text( "Hot Fuzz" );
}
*/
[/pre]

I am unable to change the value of inputbox:
[pre]
<span id="ss_number" class="form_input_element"><input type="text" name="ss_number" onkeyup="dadabik_social_security(this)" maxlength="45" value=""></span>
[/pre]

Any example would be helpful.

Thanks
 
Top