on 02-18-2008 9:53 AM
My scenario,
I have got two inputfields which is followed by a button.
A user has to enter details in the input field and then click SUBMIT.
If he/she doesn't enter details in the parameters , a message should
Intimate the user , "these fields are MANDATORY".
and it should get back to the input field.(cursor).
How can I make thas yhappen ?
Regards
Tom.
Hi,
Lets assume the two attributes names are valueOne and ValueTwo
write the following code in the action handler of the button
//first attribute
String valueOne = wdContext.currentContextElement().getValueOne();
//second attribute
String valueTwo = wdContext.currentContextElement().getValueTwo();
//if any of this is null message is displayed
if(valueOne == null || valueTwo == null)
wdComponentAPI.getMessageManager().reportException("Missing Input");
if( valueOne == null)
{
IWDAttributeInfo attribute = wdContext.getNodeInfo().getAttribute("ValueOne");
wdThis.wdGetAPI().requestFocus(wdContext.currentContextElement(), attribute);
}
// do the same for the else part for the second one too,,
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First for the end user, you can show that those input fields are mandatory. For this, create two labels before two input fields and set LabelFor property of the Label to the corresponding inputfield id. Now there is a property called "State" for inputfield. If it is set as 'required', then a red star mark appears near the label. This would make the user enter the data. If not, you may have to validate on submit button action manually. Try some options like others have suggested.
Regards,
Harini S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please see the tutorial
Regards,
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.