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

Question

Question

The Form is not saved correctly.

asked on August 12, 2016 Show version history

I have a form that I saved as PDF, the thing is that when I try to generate the PDF, is that It shows that the form doesn’t save the way is supposed to.

 

The drop-down that is where it shows something and it saves something else are charged by Jquery, the values for these are obtain in form filled up by Lookup Rules.

 

Does anybody knows how to make it save what it shows in the Form?

_PDF.png
_Form.png
_PDF.png (27.24 KB)
_Form.png (32.72 KB)
0 0

Replies

replied on August 14, 2016

Can you share what JavaScript you are using to interact with these two dropdown fields? We need to check where the 19 and 17 comes from.

0 0
replied on August 15, 2016

I´m using this JavaScript Code:

 

function addEstados()
{
	$('.cf-table.tblEstados').find('tr').each(
	function(){
		if($(this).find('.ide_est').length>0)
		{
			 var ide_est = $(this).find('.ide_est').find('input');
			 var estado = $(this).find('.estado').find('input');
          $('.cf-table.table-origenes').find('tr:last').find('select')[0];
          $($('.cf-table.table-origenes').find('tr:last').find('select')[0]).append($('<option>', { 
              value: $(ide_est).val(),
              text : $(estado).val() 
          }));
	     }
	     
		});
}

The image show the table of where i get the values.

Table.png
Table.png (17.96 KB)
0 0
replied on August 16, 2016

It is because you use customize JavaScript to dynamic generate the options for the dropdown which have both value and text attribute, and they are different, the value for dropdown submitted is the value attribute not the text attribute although it shows text attribute. On the read-only form and form generated when save to repository, you customize JavaScript no longer take effect for there is no select in read-only form(it is converted to an div element instead), so it will just show the value you submitted which is the value in the value attribute. You can comment this line of code:

value: $(ide_est).val(),

This will make the dropdown options only have text attribute, so the value submitted will be the value displayed when submit.

 

 

0 0
replied on August 16, 2016 Show version history

This time I need the value to charge the drop-down from cities,
I had previously charged the estates drop-down statically setting the options and values,this work correctly, but I need the drop-down is dynamic.
 

options_dropdown.png
html_dropdown.png
pdf_correctly.png
0 0
replied on August 16, 2016

This time I need the value to charge the drop-down from cities,I had previously charged the estates drop-down statically setting the options and values,this  work correctly,but I need the drop-down is dynamic.

html_dropdown.png
options_dropdown.png
pdf_correctly.png
0 0
replied on August 16, 2016

If you set the choices and values for the dropdown when design the form, then it will be no problem to show it on the  read-only form such as generated when save to repository, this is because Forms can get the choices based on the values from the field definition. But it won't work for list dynamically generated using JavaScript for the relationships between the values and choices are not stored in the field definition. I think you can add an hidden field to store the value from ide_est and use that to charge the drop-down from cities?

0 0
replied on August 17, 2016 Show version history

How can i do this?, because when i charge the drop-down with Lookup Rules, it lose the value; there are way to specify which column want to show and other one for value?, I can only specify one,  but in this case have two different values.

spListaEstados.png
LookupRule.png
LookupRule.png (12.13 KB)
0 0
replied on August 18, 2016

You need the value of "ide_est" in order to use it as match condition for another lookup rule which populate the cities dropdown? Can you change that lookup rule to use the  value of "nombre" as match condition so you don't need to keep the value for "ide_est"? if the nombre and and cities are not stored in same table, you can use view or stored procedure to combine them.

0 0
replied on August 18, 2016

Yes , i need it; 

 

Cities drop-down:

 

0 0
replied on August 18, 2016

Your spListaCiudades stored procedure still use id_est as input parameter, I mean can you change it to use the NOMBRE as input parameter, so you don't need to keep the value of id_est on the form.

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

Sign in to reply to this post.