Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By blackbird
#789219
I have a dynaform which containing a Drop Down list (id = acc_rej).
    Key Value 1 Accept 2 Reject 3 Change
I have also a Text field named "Change" (id = changetxt). When I will select the change option of Drop Down list then the text field will show. How can I do it?

This is my code. But not working. Hide the Change Text field is working..I have tried in many way. All codes are below.
Code: Select all
$(document).ready(function(){
  
  var acceptRejectChange = $("#acc_rej").getValue();
  $("#changetxt").hide();
  
  var selectedVal = $('#acc_rej :selected').text();
  var sv = $('#acc_rej').find('option:selected').text();
  
  
  if(selectedVal=='Change' || acceptRejectChange==3 || sv == 'Change' || sv==3)
  {
    $("#changetxt").show();
  }

});
By mishika
#789224
Hello,

To achieve your requirement you can use the following code in your javascript:
Code: Select all
$(document).ready(function(){
	$("#changetxt").hide();
});

$("#acc_rej").getControl().change(function(){
  var val = this.value;
  if(val == 3){
  	$("#changetxt").show();
  }
});
This code hides the text field when the document is loaded, and shows the text field if the value of dropdown is changed to "3".

Hope this helps

Best Regards
Mishika

Being the best in the started business is the obje[…]

Winzo is a popular and unique game on the mobile p[…]

Cannot create process using templets

Real details. The problem was solved by effect!

However, it is essential to use it responsibly and[…]