WebSite X5Help Center

 
Sinisa B.
Sinisa B.
User

Database viewer - column names (labels)  en

Автор: Sinisa B.
Просмотрено 314, Подписчики 1, Размещенный 0  

Hi All,

I am filling the database via a form (OPTION: send to database).
I am using the DATABASE VIEWER object to show the collected data.

Due to the FORM field rules, the database field name cannot contain SPACE (cannot use two or more words as a field name). Thus in the table view of the DATABASE VIEWER, the column name (aka column label) is shown as SINGLE WORD without spaces between words (see below).


I know that in PHPMyAdmin I can change the names of the columns of the database table and thus have two or more words in a column, but then I cannot fill in the data via the form because it will add columns of different names (no space names).

I also know that I can directly enter data using the DATABASE VIEWER and that the above (form) problem could be avoided, but I have to enter data via the form for legal reasons!

So, my question is:
Is there a way to use FORM (send to database option) to fill the database so that in the Database Viewer column names (column labels) could have two or more words separated by a space?
I would like to avoid the underscore "_" charater as a separator...

Thank you in advance for your help!

Размещено
11 Ответы - 3 Полезно
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Лучший пользователь месяца ESЛучший пользователь месяца IT

(It > En)  ...if you can't find any other solutions, and just to improve the visual appearance on the monitor, if you post the link to the page in question, some of my dynamic JavaScript code could be considered; otherwise, ignore my post, as if I hadn't said anything...

.

ciao

.

Читать больше
Размещено От  ‪ KolAsim ‪ ‪
Daniel W.
Daniel W.
User
Лучший пользователь месяца DEЛучший пользователь месяца EN

The words could be visually separated by the character _

Serijki_Broj_Racunala

Windows_Lozinka

Windows_Pin

Читать больше
Размещено От Daniel W.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Лучший пользователь месяца ESЛучший пользователь месяца IT

... he wanted to avoid it because it was unsightly, ... but it is possible to use the underscore "_" to separate words, and then with my EXTRA(!) code show the normal words, without the hyphen...

.

ciao

.

Читать больше
Размещено От  ‪ KolAsim ‪ ‪
Sinisa B.
Sinisa B.
User
Автор


@KolAsim & @Daniel 

Thank you! Pls. read below


Yes, I know I can use "_" to "visually" separate words, but I would like that "_" not to be visible in the Database viewer table.

@KolAsim - If you could give me your PM, so I can send you the link and user name/password?

So, the problem is:
How to input data via FORM, so that in the Database viewer shows column names separated?

For example:

If I have a data field in a form, WindowsPassword, I want to be able to display it in the Database viewer column as two words separated by "SPACE", Windows Password.

I could use "_" in the database field name as a "separation marker" between the two words—no problem.

So, it's purely a visual representation, not a change in the name of the field in the database...

Thank you!

Читать больше
Размещено От Sinisa B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Лучший пользователь месяца ESЛучший пользователь месяца IT
Sinisa B.
... ... ... @KolAsim - If you could give me your PM, so I can send you the link and user name/password? ... ... ... 

... it's not possible, but you can do it anyway with this procedure...
... separate the words with an underscore "_"...
... for the test, you could use a temporary user, which you'll then delete immediately after the test...
... for example:
user: pippo(At)xx.yy ... (At) instead of @ because the email wouldn't be visible here...
pass: 1234
...
... or you can use my invention yourself if you determine the reference selector of your form for the variable objK:

<script>
$( document ).ready(function() { //K>
setTimeout(function(){
objK =$( ".jtable-column-header span " );
for(var i = 0, TotK = objK.length; i < TotK; i++){ //K1>
var strK = $(objK[i]).text();
var strK = strK.split('_').join(' ');
$(objK[i]).text(strK);
} //K1<<
},3000);
}) //K<<
</script>

.

ciao

.

Читать больше
Размещено От  ‪ KolAsim ‪ ‪
Sinisa B.
Sinisa B.
User
Автор

@ KolAsim ‪ ‪

Thank you very much!

OK-I'll use "_" in the FORM's database field names.

Could you write me here some instructions on where I should put your script and what script editing is needed to work as I want?

Just to repeat the goal here:

To display column titles (form's data fields) as separate words if they contain more than one word via the Database viewer object.


KolAsim, thank you in advance!

 

Читать больше
Размещено От Sinisa B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Лучший пользователь месяца ESЛучший пользователь месяца IT

... write the names like this:

Serijski_Brogj_Racumala
Windows_Lozinka
Windows_PIN

... my code will replace the "_" with a blank " "

Serijski Brogj Racumala
Windows Lozinka
Windows PIN

... ... ... 

... Right-click on the column name and find the class...
... the class name, if different from mine, replace it in my code in the first variable objK...

.

Читать больше
Размещено От  ‪ KolAsim ‪ ‪
Sinisa B.
Sinisa B.
User
Автор

@KolAsim

Thank you very much for your effort!

I'll try it today and let you know!

Best!

Читать больше
Размещено От Sinisa B.
Sinisa B.
Sinisa B.
User
Автор

@KolAsim

It works as it should - the class name was the same as the one in your example.

Again, KolAsim - thank you very much for your help!

Читать больше
Размещено От Sinisa B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Лучший пользователь месяца ESЛучший пользователь месяца IT

... OK ... ciao

.

Читать больше
Размещено От  ‪ KolAsim ‪ ‪