开发者

How to dispay default value instead of {, }?

开发者 https://www.devze.com 2023-02-21 02:59 出处:网络
I have this situation where on my main page, there are different fields and some of the fields in div are getting their values from Billing page.

I have this situation where on my main page, there are different fields and some of the fields in div are getting their values from Billing page.

So on my main page, I have something like:

<span class="label">
    <form:label path="billingInfo.contractTerm" cssClass="normalText"
        cssErrorClass="normalTextRed" >Contract Term Length (months):</form:label>
</span>
<span class="formw">
    <form:input path="billingInfo.contractTerm" cssClass="normalField"
        cssErrorClass="validationError" size="25" disabled='false'/>
</span>

Now if value for contract term is not present on billing page then on my main page, am getting {,} in the box but I do not want to show that to end user, is there a way I can just keep it blank, also I want to understand as to why it g开发者_开发百科ets value {,} if values are not present on billing page for that field.

Any guidance and explanation would really help as I am trying to understand this situation.


Issue here was I had two entries

<span class="label">
        <form:label path="billingInfo.contractTerm" cssClass="normalText"
            cssErrorClass="normalTextRed" >Contract Term Length (months):</form:label>
    </span>
    <span class="formw">
        <form:input path="billingInfo.contractTerm" cssClass="normalField"
            cssErrorClass="validationError" size="25" disabled='false'/>
    </span>

For each different div and in my controller there was binding issue which gave rise to error mentioned. Finally I got rid of it and its working as expected.

<span class="label">
        <form:label path="billingInfo.contractTerm" cssClass="normalText"
            cssErrorClass="normalTextRed" >Contract Term Length (months):</form:label>
    </span>
    <span class="formw">
        <form:input path="billingInfo.contractTerm" cssClass="normalField"
            cssErrorClass="validationError" size="25" disabled='false'/>
    </span>

Updated so if someone has similar issue then they can take pointer from this answer to not have duplicate ids instead create a new id or have refer to single id in different divs.

Thanks.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号