Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript JSF
Dear Sir / Madam ,
 
Good Afternoon ,

I have problem with following codes ,
 
JSF :-
------
 
<rich:comboBox id="RelationShip" valueChangeListener="#{memberBean.relationshipChanged}"
    rendered="#{sourceBean.profile.familyInformationEnabled}"
    suggestionValues="#{memberBean.relationships}"
    value="#{memberBean.relationship}"
    enableManualInput="true" directInputSuggestions="true"
    defaultLabel="NA"
    onselect="validateRelationshipGender();">
     <a4j:support event="onselect" ajaxSingle="true" reRender="ContactPersonGender" />
</rich:comboBox>
 

<rich:comboBox id="ContactPersonGender"
                                        rendered="#{societyProfileBean.currentSociety.profile.familyInformationEnabled}"
                                        suggestionValues="#{member.genders}"
                                        value="#{member.gender}"
                                        enableManualInput="false" directInputSuggestions="true"
                                        defaultLabel="NA">
                                    </rich:comboBox>
 
JS Code for Validation :--
 
function validateRelationshipGender() {
 
        var gender, genderForm;
        gender = document.getElementById("NewUser:ContactPersonGender").value;
        genderForm = document.getElementById("NewUser:ContactPersonGender").disabled = true;
        if (gender == "Male" || gender == "Female") {
 
            genderForm = document.getElementById("NewUser:ContactPersonGender").disabled = false;
 
        }
 
    }
 

..........................................................
 
Validation is not working for me , gender values comes form table , and relationships from bean.
 
What i need means once i select relationships it take some time to come value from bean,in that processing time i want disable and enable that gender drop-down box
 
My problem is while i give JS validation its not working , once i removed validation code its working fine ,
 

 

 
Give some guidance to proceed further ,
 
Thanks in advance ,
 

Sankar .
Posted 14-Oct-12 21:59pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Add following statement in function
return false ;
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 BillWoodruff 85
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 15 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100