You are viewing limited content. For full access, please sign in.

Question

Question

Write to table input and that same thing gets overwritten in html at the same time

asked on June 17, 2023 Show version history

Hello, actually i have a problem with one table , I need it when writing in the field also overwrites in the advanced HTML.

 

I have one code in javascript but only fuction with individual fields not in tables

My table

 

 

 

 

This is my HTML advanced 

 

This is my code in JavaScript 

$(document).ready(function(){
	$('#Field3(1)').change(function(){ 
  valor=$(this).val();
  	$('#p1').val(valor);
  });
});

'#Field3(1)' = name or ID of my field of my table 

'#p1' = is the ID of my field HTML advanced

0 0

Replies

replied on June 19, 2023

Is it not writing anything at all to your HTML input field?

Does the variable valor have a value after you set it?

Have you tried using class names instead, which you can set under advanced properties of any field.

1 0
replied on June 19, 2023

1.It does not get overwritten in my html field even though I write 

2. No the variable valor does not have a valor unless you write it to the forms field 

3 No Im not using a class name in forms if you give me a one example , I aplicated the example 

thanks you 

0 0
replied on June 19, 2023

Based on your answer to #2 it sounds like your function is working properly. If you write to Field3(1), then it is copied to p1

0 0
replied on June 19, 2023 Show version history

No, the function is not execute correctly when they are fields in table

 

Only function on fields that do not belong to a table

 

actually if i write to Field3(1), then it is not copied to p1 (my html advanced)

0 0
replied on June 19, 2023 Show version history

The issue is likely the table/collection and how event handlers are applied.

The following might help.

Table and Collection JavaScript Event Handlers - Laserfiche Answers

0 0
replied on June 19, 2023

1.It does not get overwritten in my html field even though I write 

2. No the variable valor does not have a valor unless you write it to the forms field 

3 No Im not using a class name in forms if you give me a one example , I aplicated the example 

thanks you 

 

replied on June 19, 2023

Is valor a global variable? How are you checking the value of it? By logging to the console? Your not getting any errors when checking the value of it? Just an empty value?

Since your on the first line of a new function, you can only see global variables. Otherwise you need to create a valor variable with let valor = $(this).val();

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.