Revision history [back]

click to hide/show revision 1
initial version

asked 2014-03-26 13:57:27 +0800

abpa gravatar image abpa

Need validation for checkbox, radio, listbox

Hi ZK team,

We are in process of customizing a few ZK components to make them behave as what our business partners need. For instance, I have already prepared a new textbox that instead of showing the error bubbles, it shows the error as a red label under the textbox and it works great.

However, we need validation on components such as list box and radio button and check box. One example is that, in order to continue with submitting a application form, select box A can only have value X, otherwise we should show an error bubble for that select box saying that "you are not eligible for this".

I have searched a lot in the ZK source codes and even in your forums, etc. and as I understand only InputWidget components can receive the error event from the server side and Widget components are unable to do so.

The way that we add the error messages on the server side is:

addInvalidMessage(ctx, ctx.getProperty().getProperty(), "error message");

And for my extended textbox on the client side, I am using these functions:

_markError: function (msg, val, noOnError)

and

clearErrorMessage: function (revalidate, remainError)

and

showError_: function (msg)

Now my question is, is there any way that we can make a Widget (for example a check box or a radio button) receive these error messages on the client side? even if it requires a trick.

Thank you very much in advance!

-Sami

Need validation for checkbox, radio, listbox

Hi ZK team,

We are in process of customizing a few ZK components to make them behave as what our business partners need. For instance, I have already prepared a new textbox that instead of showing the error bubbles, it shows the error as a red label under the textbox and it works great.

However, we need validation on components such as list box and radio button and check box. One example is that, For example, in order to continue with submitting a application form, select box A can only have value X, otherwise we should show an error bubble for below that select box saying that "you are not eligible for this".

I have searched a lot in the ZK source codes and even in your forums, etc. and as I understand only InputWidget components can receive the error event from the server side and Widget components are unable to do so.

The way that we add the error messages on the server side is:

addInvalidMessage(ctx, ctx.getProperty().getProperty(), "error message");

And for my extended textbox on the client side, I am using these functions:

_markError: function (msg, val, noOnError)

and

clearErrorMessage: function (revalidate, remainError)

and

showError_: function (msg)

Now my question is, is there any way that we can make a Widget (for example a check box or a radio button) receive these error messages on the client side? even if it requires a trick.

Thank you very much in advance!

-Sami

Need validation for checkbox, radio, listbox

Hi ZK team,

We are in process of customizing a few ZK components to make them behave as what our business partners need. For instance, I have already prepared a new textbox that instead of showing the error bubbles, it shows the error as a red label under the textbox and it works great.

However, we need validation on components such as list box and radio button and check box. For example, in order to continue with submitting a application form, select box A can only have value X, otherwise we should show an error below that select box saying that "you are not eligible for this".

I have searched a lot in the ZK source codes and even in your forums, etc. and as I understand only InputWidget components can receive the error event from the server side and Widget components are unable to do so.

The way that we add the error messages on the server side is:

addInvalidMessage(ctx, ctx.getProperty().getProperty(), "error message");

message");

And for my extended textbox on the client side, I am using these functions:

_markError: function (msg, val, noOnError)

noOnError)

and

clearErrorMessage: function (revalidate, remainError)

remainError)

and

showError_: function (msg)

(msg)

Now my question is, is there any way that we can make a Widget (for example a check box or a radio button) receive these error messages on the client side? even if it requires a trick.

Thank you very much in advance!

-Sami

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More