Skip to main content
Topic: javascript working not corectly if field is same name. (Read 2184 times) previous topic - next topic

javascript working not corectly if field is same name.

javascript will working not corectly if field is same name because phprad use a main function script (file name : page-script.js)
if control name was the same name.
(ex. table 1 have field group_id and table 2 have group_id too.)
javascript that assign to table1 page will tricker on table2 page too.(because group_id is the same name. :-X


Re: javascript working not corectly if field is same name.

Reply #2
@willvin I use to disable fill on first table after input,but other table I didn't use to disable it.


Re: javascript working not corectly if field is same name.

Reply #4
@willvin to clarified as you can see in picture table1 have a field id_group and table2 have the same field name.(I use to filter data.)
Then,when phprad generate code it use #ctrl-id_group as the same code on page for table1 and on page for table2.This will trigger script from page1(table1) on page2(table2) too.Because phprad use file page-scripts.js as a global script to all pages.


 

Re: javascript working not corectly if field is same name.

Reply #6
@tin‍ please change the database column name to something different.
I don't think that is a solution @willvin ,because I use as a foreign key in relation.

Re: javascript working not corectly if field is same name.

Reply #7
@tin‍ that is the only way until an update comes out. Unless you want to manually change the id used by the javascript and editing the Add and Edit page as custom to change the id of the field you want to change.

Re: javascript working not corectly if field is same name.

Reply #8
@tin‍ that is the only way until an update comes out. Unless you want to manually change the id used by the javascript and editing the Add and Edit page as custom to change the id of the field you want to change.
@willvin Thank you.Wait for update.I manual it now.