3

My doubt is : I have custom vf page for account object . I have few disabled fields in that page whose values will be populated based on autocomplete field selection using jquery autocomplete widget. I have few other mandatory fields after the disabled fields.

Test scenario :

  1. I will select one value from autocomplete field which will populate the disabled fields.
  2. I will not fill the mandatory fields . On click of save error for mandatory fields is thrown but it is clearing the disabled field values. Eventhough i am using some hidden fields to store the values of disabled fields it doesnt help.

Any solution how to keep the values intact in disabled fields will be of great help. Let me know if i am not clear ,i can explain the doubt if required.

2
  • Are you use an inputField? Commented Oct 9, 2013 at 11:16
  • nopes i am using inputText for disabled fields.
    – Sf Dev
    Commented Oct 9, 2013 at 11:29

1 Answer 1

1

If your inputs are anyway hidden you can use just a normal html fields to output/show the selected values and use hidden fields to assign values to use in controller.

<script>
    function someFunction(){
        jQuery('[id$=myVar1Hidden], #myVar1Output').val(value1);
    }
</script>

<!-- This will be used to pass the variable to the controller -->
<apex:inputHidden value="{!myVar1}" id="myVar1Hidden" />

<!-- This is only to show the selected value to the user on the page -->
<input type="text" id="myVar1Output" value="" disabled="disabled" />
2
  • using apex:inputText and normal text to display is the same.
    – Sf Dev
    Commented Oct 9, 2013 at 11:40
  • I figured it out myself . When i checked the page source the hidden values corresponding to disabled fields were having the values while disabled values were not . I populated to hidden values into disabled fields on page load and hence its showing now. Thanks for all the inputs which helped me get to the desired solution.
    – Sf Dev
    Commented Oct 9, 2013 at 11:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .