Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am working with SharePoint 2010 form library.

I have a drop down column which is dependent on text input column value .

The value in the Text input column comes from the infopath form.

What i want is :-

Suppose the text column value is "AU" then disable the Drop down column otherwise enable it.

I want to code this in Sharepoint Form library Edit page(Editpage.aspx).

I think it would be possible with Jquery.

Any help/suggestion would be highly appreciated.

Regards

Kishan

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I have solved this problem:

Below is the source of the Javascript attach it with code.

src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"

write this all code in the javasrcipt tag

$(document).ready(function() {    
    // add change handler 
    $("input[title='Test Value']").change(function()     
    { 
        MasterSelectChange();     
    }); 

    // call the change function to set up form for first display: 
    MasterSelectChange();     
});

function MasterSelectChange()    
{    
    var thisVal =  $("input[title='Test Value']").val();      
    if(thisVal == "AU")     
    {     
        $("select[title='Test_Status']").closest("tr").hide
    } 
    else 
    { 
       $("select[title='Test_Status']").show();      
    }     
}
share|improve this answer

Actually, I guess, you don't need to use JQuery for this. You can disable dropdown using InfoPath too. Just use rules on InfoPath. And you can hide the whole row like this:

$('#>id<').parents().parents().parents().parents().eq(0).hide();

You must reach the parent.

share|improve this answer
    
Thanks @compengTR for your reply: But this Test_Satus column is the lookup column. & this Test Value column is the infopath form(Check box) value. So how can we edit this lookup column from infopath form. Any Suggestion would be appreciated. –  Kishan May 11 '12 at 11:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.