How to bind data in controls and edit accordinly on dropdwonlist selectedindexchagned event in mvc4 razor using jquery? - asp.net-mvc-4

I have a view for create/ edit data, in my view contains a dropdownlist control and two textboxes and two buttons [Create, Done Modifications], and my requirement is like below.
User should be able to select his/her name from dropdownlist which contains list user names. By default create button is visible and ‘Done Modifications’ button should be invisible.
Based on the dropdownlist item selection, if the record is already exists then show up his/ her data in DOB, Location textboxes then invisible Create button and able to update to the database by Done Modifications button.
Data population, edit, create, delete logic should be implement in Controller classes.
Above things should be happen in asynchronously, I don’t want to allow post backs on any events.
Thanks for your time!
Sridhar Goshika

What is the hourly rate you are going to pay for this?
This is a list of specifications given to you, that you pass on to us; It does not show any research, any code showing what you have done and where you are at. Moreover, there is no question there.

submit() method will submit the form by dropdownlist item selection
#Html.DropDownList("ProdID", null, new {#onchange="submit()" })

Related

Dynamically Add Option Buttons to Excel UserFrm with One Event Handler

I have a custom user form in Excel where the number of option buttons is dynamic, depending on what a user selects from a combo box. I have written a script that will add and format those option buttons with appropriate captions, groupname, etc. However, I would like it so that after those buttons are added dynamically, if a user clicks a button from a group just added, then more code will be executed. I am aware that one can create a custom class so that multiple userform controls are handled with one event handler, but I can't figure out how to get this to work with controls that were added dynamically to a form, after the form initialized. I am hoping this question makes sense. Thanks in advance for any help you can offer.

MVC PartialView page rendering dropdown value and checkboxes

I am working on an mvc page, it has 2 partial views and one controller action. In one of the partial views i have a button, this button checks if the user entry exists in the database. in the other partial view i have a drop down and a table, the table is populated based on the dropdown selection.
My issue is, everytime I select some values in the table( all are check boxes) then enter some values for "Verify" button the form refreshes and clears out all selected checkboxes. is there a way to fix this?
P.S.:
I am using Viewbag to bind to dropdown selection and onchange event for dropdown.
Please guide me in fixing this. this is driving me insane.
Thank you.
If I undestand you as correctly, You can use javascript I think :). Also If you dont want to load all page, you can look ajax post with partial View in MVC
This may help your problem :D

restricting a combobox to list values and outdated list values

I am creating a program that for simplicity's sake records the name of a staff member that receives a phone call. This program is designed to show old entries along with creating new ones.
The problem is that I want a user to only be able to select a listed name from the drop box when creating a new entry. But this list will only show current employees. Yet, when viewing older calls this combobox field also needs to display former employees that took a call that may no longer be in this list.
As far as I can tell with the Microsoft control and properties there is only 2 options that relate to this matter.
DropDownStyle as DropDown or DropDownList.
When using DropDown the user can submit any name (which is not wanted).
With DropDownList the user can only submit names on the list, but when browsing through old entries any names that are no longer on that list will not appear on their respective calls (which is also not wanted).
I'm aware I could end up having to implement my own combobox class but I wanted to see if anyone knew of a more elegant fix that combined both of these functionalities. Thanks!
It seems to me you have two modes. Add mode adds a new call record, while view mode displays old records.
Use the drop down list to restrict the user to what you load. When in Add mode, load the control with only current employees. When the form is in view mode, load with all employees.
Use DropDown. In the Validating event, set e.Cancel = True and instruct an ErrorProvider control to put up a warning with its SetError method if SelectedItem Is Nothing, but clear the error (by passing Nothing to SetError) otherwise. Then, in the combo box's SelectionChangeCommitted event, call the form's Validate method.

Check if Access 2010 Navigation Subform is Open

I am developing a program to track client information that utilizes a navigation form as a main menu that is open at all times. Many of the subforms have list boxes that need to be requeried as data is entered/changed or the users tend to think that they haven't changed the recordset and we end up with duplicate data. I can't figure out how to check if a specific subform of the navigation form is open before I run a refresh... they are all referenced as 'NavigationSubform'. So, for example, if I add a new job placement for a client, I'd like to run a requery of this listbox in the 'onclose' event to make sure they have the newest info. I can do it... Forms!navMain!NavigationSubform.Form.lstEmployment.Requery ... but it bombs if the user has changed panes on the navigation form before closing the form. This happens a lot: for example, a client interrupts while you are entering Job Placement info and you stop and enter a counseling note before going back to it, leaving the main menu sitting in the 'Clinical' directory. Is there a way to check if a specific subform is loaded within the Navigation Subform object? I've attached a screen shot in the event it helps this make sense.
Thanks in advance for any suggestions!!
Employment Screen
It has been a while but I believe you can use the isLoaded method to determine if a subform is loaded
http://msdn.microsoft.com/en-us/library/office/ff194656.aspx
hope this helps,
Brent
You can check the contents of a subform control with the source object property, for example:
forms!mainform.asubformcontrol.sourceobject
You can also get the name of the form from the form object:
forms!mainform.asubformcontrol.form.name

Ms Access 2007 ComboBox

I am using Access for a quick and dirty (ADP) interface for an SQL (Express 2012) database so data entry can begin before the MVC web app interface is complete.
There is one field I want to be varchar, I would like this field to either allow the user to type in a value or select from a distinct list of values previously used in that field.
I have that part down, but the problem is when it happens, I have to refresh the recordset to see the new item in the list, so if they choose add a new record, then the last item added is not visible in the list.
So I can get the distinct list, populate the box, allow for new entry, and save that to the DB, do I have to write a code behind to repopulate the recordset, do I need to write a code behind to maintain the list paralleled to the recordset, or is there just a property I am missing?
Thanks
(Added screen showing event)
As suggested, using the on current event on the form and the after update solved the problem.
Clicking the form section detail selected the detail sections property page not the form. Selecting the form from the drop down on the property page displayed the events I was suggested to use.
Many thanks to those contributing.
As the first suggestion of this was from Remau, with assist in locating that event from hansup, I will mark remau's post as answer. Thank you to both.
Don't requery the form, just requery the combo. The best bet is probably the current event which will work if more than one person is doing data entry. It will also work if people are editing the table as well as entering data. Events that only fire when a record is added will not pick up changes to the combo contents.
Private Sub Form_Current()
Me.MyCombo.Requery
End Sub