문제

I want my <s:select> to be readonly, I don't want it to be disabled because I have to submit the value of <s:select> to my action class.

Here is other question related to this (Question), but the answer given has not worked here.

Is there any way to readonly my <s:select>, how can I achieve this???

도움이 되었습니까?

해결책

You can make the <s:select> tag disabled and have a hidden field having its name and value. so, that it can be sent in the request to the server for processing.

다른 팁

Thank Keerthivasan

Example

<s:select value="aaa" id="source_id" listValue="name" disabled="true" />
<s:hidden name="destination_name" />


$('input[name="destination_name"]').val(
    $("#source_id option:selected").val()
);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top