How to secure data in html select object filled with Ajax from MVC database - model-view-controller

sorry for my english
I am filling the select element with values ajax from the database. Then I want to verify that the data that changed when the user posted the form as a result of changing the value values of the select object through the browser is really the data I filled.
How can I solve this with a general coding in infrastructure?
Instead of going to the database and checking each filled data one by one, I want to hold the data I filled in the select tag and check the verification with this data in the post operation.
mvc fill select changed value example

Related

Form WHERE clause

I have an APEX form I'm developing for "user settings". I have a table with a sequence as a primary key and the users ID in another column...in addition to a few columns where each users saved settings are stored (things like "N" for do not receive notices).
I haven't used Oracle APEX in a while so excuse this likely newbie question...The insert works fine, but I'm having trouble with making the form only show the current users values. In my Form Region the source is set to my Table, and I have a WHERE clause like this:
USER_ID = 813309
But that's not working (813309 is my id and I'm just hard-coding it for now). The form always comes up with a "New" record.
For a form to load a specific record you can set the primary key page item to the value you need. You can do so in the url using the link builder from another page or you can set a computation on the item. That is what I would try in your case: add a computation to your item P_USER_ID of type "Static Value" with value 813309. Make sure the computation happens before the "Fetch Row" - the value obviously needs to be set before the process runs.
In such cases, I prefer creating a Report + Form combination (using the Wizard, of course): it creates an interactive report (so that you can review data in a table), and a form which is used to add new records or update/delete existing ones.
Doing so, when you pick a user in interactive report and click the icon at the beginning of a row, Apex redirects you to the form page, passing primary key column value to the form which then fetches appropriate data from the table.
Not that it won't work the way you're trying to do it, it's just simpler if you let Apex do everything for you.
So: did you create an automatic row fetch pre-rendering process? If not, do so because - without it - Apex doesn't know what to fetch. Also, if you hardcoded user_id, it won't do much good. Consider storing username into the table so that you could reference it via :APP_USER Apex variable.

Delphi validate database fields before TEdit exit

I've a strange question I tought about for exercise that is not easy to explicate.
Suppose I've a form with some TDBEdit object. Nturally every TDBEdit object reference a database field.
Here a simple example:
When the user click the save button (the little disk icon on the top of the image) I make the data validation and, if data are correct, I register them into the database. Simple!
But my mental exercise is this:
all my data tables are included in a datamodule so what about if I would like to trasfer the data validation from the form to the datamodule?
Simple... it's enough to validate the table fields like this:
if (fAut_Cognome.Value = '') or (fAut_Nome.Value = '') then begin
...
Give error messsage
...
end;
But If the user doesn't leave the last TDBEdit object the relative database field is not valorized (for example while adding a new record to the table the database field will ane no value).
So my question is this: there is a way to validate data, from datamodule, even if the user doesn't leave the TDBEdit control?
You should plug the OnBeforeExit event of your TDBEdit to a method in the Datamodule. But as said in comments you will only test the control's value, not the DB field's value because not updated yet.

Check if Associated View is blank in Dynamic CRM Online

In CRM Online on a customer form is there anyway that you can check if the Associated View for Assets is blank? And if its blank change a field value based on it.
Using JavaScript, 2 ways:
The associated grid is showing records related to your primary record. You can perform the same query the grid is doing using REST which will tell you if there are any records. You can then count the records, and change the field value as required. This approach is better if there are records in the database but which aren't shown in the view for some reason, e.g. view filters.
Access the Grid objects data using getRows(). As above you can then count the records, and change the field value as required. The downside of this is I believe those methods only give you access to the records shown on the form (and not any hidden by filters but still in the database) - but I don't think that that will be a problem here.
Worth bearing in mind that this approach only works client side, e.g. someone has to be actually looking at the form.
If you need to cover the a non-client side approach, e.g. workflows creating records, then you should probably look at plugin development so the changes can be performed server side.
As a side if you just want a simple count shown on form you then you should probably look at Calculated Fields and in particular Rollup fields. You might also be able to run further client side JavaScript from the count.

joomla dynamic drop down on registration form

I have two drop down list on my registration page of sql type. they both fetch data from database. but my problem is that in second drop down list , i want specific data as per the option selected in dropdown list 1. how to do it?
thank you very much
There are two possibilities(well theoretically endless)..
1) You send the whole data on pageload and then filter it using javascript based on the first selection.
2) Use the ajax technique, where you send the ajax handler the selected value and then the handler queries the database and sends the relative data which you append on the second select in the runtime.
Note:- for larger tables the firstone is NOT Recommended.

Other way to speed up Microsoft Access Form Load with Datasource

I am tasked to fix a performance issue on a Microsoft Access Form. The page has a datasource using a Query. The Query joins several tables and does summation. The problem is when the page loads, the form uses a dummy value like QueryColumn = 'ImplossibleValue' to show an empty.list. The form contains search condition filter plus search button. When the search button is click the correct Filter is set.
Because the query handles a lot of data, the page loads very slow at first but when the form opens the user is presented with blank query as design. Is there a way to Open the form and to make it have no data source?
You can change the recordsource to a query which returns Null values and need not reference any of your tables.
SELECT Null AS field1, Null AS field2;
After the user selects her search criteria, change the recordsource to the query which incorporates those criteria. Changing the recordsource automatically triggers a requery.
If a user saves the form design after the recordsource has been changed to the search query, the form will use that again the next time it is opened. You can force the form to always open with the dummy row query as its recordsource by resetting that property during the form open event.
Me.RecordSource = "SELECT Null AS field1, Null AS field2;"
When you open the form, use a where condition in the docmd.openform statement. where primarykey = null there will be no records and you don't need to unbind the entire form.
I had similar performance problems with Jet 10 years ago, and the only resolution I found was to move to Access Data Projects.
Upsize to client-server application using SQL Server, run a couple of query wizards to determine proper indexing, and you'll have excellent performance in no time.

Resources