How to place error message appropriately in ASP.NET MVC? - asp.net-mvc-4

I have check boxes for working days if user does't select any one of the checkbox we need to show error message but after showing error message alignment is not correct as shon in the below picture.

You can move your check boxes validation to #Html.ValidationSummary()
(i.e. don't create #Html.ValidationMessageFor() for every checkbox, but display it in separate html div)

Related

Popup LOV not showing selection when changed

I have a popup LOV page item in my oracle APEX application who's list is pulled with a SQL query. When I try to change the value of the popup LOV from runtime the new value is not displayed in the page item.
I can tell that the change is registering and that the value is being stored because I have a dynamic action that depends on the value of the page item that is working correctly. In addition to that the debugger is confirming that the value is being stored in the page item but the page item isn't displaying a value.
A few other things that might be worth noting:
When I statically assign a value to the page item that value displays as intended but when I switch the value from the static assignment it doesn't show up.
I have other popup LOV page items that are doing almost the exact same thing in the same application and don't seem to have this problem. I have double checked the attributes of the page items and I can't find any discrepancies that would cause this, but I am new to Oracle APEX so I might have missed something.
After removing the popup LOV page item as one of the "items to submit" in a dynamic action that was triggered on the popup LOV changing, the problem was solved.

Check some field before opening confirmation box in ODOO

I want to check that if some fields in the form view has been checked or not. If they have been checked then show a confirmation message and if not then a error message saying that those fields must be checked. For this functionality I have created a button which calls a specific function in the model. The button has also attribute confirm which enables the confirmation pop up box. But all the time it first opens the confirmation message and then the checking for the fields. I want to have the other way around how to achieve this. Please help.

How to handle dynamic text with no div tags and no info where they are coming from in Selenium?

I have registration form for which I am trying to create a script.If we don't enter any value in any of the fields and click submit, it is showing a dynamic error message that "Please fill out this field!"
There is no div tag for this text. Moreover, if we click anywhere on the screen, it is disappearing. Can anyone tell, how to read this text?
Thank you.
When the field is marked as required, the Browser shows the message when the form is submitted. There is no way available for you to access it.
You can handle it within your test code by checking that all required fields are entered before submit is called.

Display an xpage alert when a value is exceeded

I need to display an alert on the xpages application. The condition is that if the entered value exceeds a percentage in relation to a value from the previous month the alert message is displayed. What would be the best way to implement this functionality? The component where the value is entered is a dojo number text box.
Should I treat the alert on the button where I submit to xpage? I thought that in the button code I could have two action groups, one that would remain as it currently stands, in which case the value would not exceed the percentage. In the other group of actions, for when the value exceeds the percentage, it would display a dialog stating that the percentage was exceeded and if the user would like to continue through an ok button, or correct the value through a cancel button. On the ok button, the same actions from the previous group would be inserted. Would these actions work in the context of the dialog box, correctly saving the datasource? Am I on the right track, or is there another simpler way to implement this alert, for example, when typing the value already display the alert?
It is important to point out that this is only an alert and not a validation that prevents the user from submitting to xpage.
Grateful!
Marcus.
You could test the value in the onChange event of the input control. Your alert could use Boot Alerts to display an alert that the user would see in the browser.https://xpage.me/2015/02/10/boot-your-alerts-in-the-with-bootalert/ or Growl http://elstarit.nl/2015/02/20/my-taken-on-a-multi-growl-message-phaselistner-for-xpages/

Report Viewer in MVC3

I have written a report in asp.net MVC 3 with the report viewer using a user control (ascx) in a partial View in the Report.cshtml(View). I'm having a problem with report viewer control when I run the application. When I have more than two pages and I want see the second or more page, I get "microsoft jscript runtime error '__eventtarget' is null or not an object".
The error is because there is postback. How can I fix this?
You're not going to be able to use the built in toolbar to navigate. (At least not without finding your own work around).
What I did was created my own bar right above my control and it simply sends an action ("First", "Last", "Next", "Previous") to an action on the controller to adjust the ReportViewer's CurrentPage Variable. (I keep tract of the current page through the session and set it in the user control ascx).