VB.NET How to detect which textbox is active and insert data on it - textbox

Welcome
I have 3 textboxes and one button
When I click on this button , I want to check which textbox is active , the cursor of mouse is on it and put the data on these text box
For Example in my button it will check which one is active and put data ( anything ) on it
I need your help
Thanks

You can use Me.ActiveControl.

Related

Delphi DBGrid disable clicking on another row when editing

I have a dbgrid displaying data from a Ttable and my problem is that when
editing a row in the grid the focus is on the row that I want to edit but I can
still click on another row and edit it. How do I disable clicking on another row
or keep focus on the same row?
Second question is (still on the dbgrid) when I edit a column and double click on that column,
the focus moves to the end of the text line therefor not showing the original text but only showing maybe the last character and spaces.
Please help...
After a while of playing around with this, I've discovered that there's no easy way
to disable the user from moving from the highlighted row (row to edit) when clicking another row.
The best way is to cancel when he clicks on another row, I'm using a TTable and TQuery, so
on the BeforePost event, just do a cancel on your table or query. But you also need to do the
same on the AfterScroll even, just in case.
Thanks for all your help.

Update values set in autocomplete dynamically created textbox

I need ideas to handle the mouse click selection and the hand written text in an autocomplete textbox to be saved through a controller in JQuery.
Im clear with the saving part, the issue im facing isthat when I select (click) on any option in the autocomplete box, the onblur is called and it only takes the first word ive typed and tries saving it to the database.
Whereasif i comment out the select event in autocomplete and only handle onblur of the textbox, the handwritten value is saved and the clicked value from the autocomplete isnt saved.
Any ideas ?

Pop up data is not clearing in Richfaces 4.0

I am new to Rich Faces and we are using richfaces 4.0. We are having an pop up requirement in our project and we used rich:popupPanel.
In the pop up we are having a form with 5 to 10 input text boxes and selectManyCheckbox components.
Whenever the user opens the pop up, fills the data and click Save, the data is being saved properly.
But when the user opens the pop up again, the already entered data is being displayed, actually it should be an empty form.
Can anyone help me on this?
Thanks in advance.
It is probably because the backing bean that supply the values to your controls in the rich:popupPanel is in the session scoped and you forget to clear these values in the action method when the save button in the rich:popupPanel is pressed.
Please check if you really clear these values in that action method

sharepoint button Name

In SP Designer, How do I change the default text in the button. Like OK--Submit and Cancel--Go Back.
Can I change it, If yes what where does the mapping goes ..
Thank you..
You can change the text of Buttons in case of custom List Form
Right Click on OK Button select proporties
Select Indesgin as True
Change the Text to Submit
Repeat above steps for Cancel button as well

ModelState.IsValid for invisible controls

I am working on MVC with C#.
I have 2 radio buttons. On selecting first radio button, a textbox will be shown which allows to enter date values.
<%= Html.TextBox("ReceivedDate")%>
on selecting the second radio button, the textbox gets hidden.
For the first time, when i select first radio button and entered date and clicked Next to navigate to next page and came back to this page again and clicked second radio button and clicked Next to continue and again i came back to this page and without changing any option click continue, its not allowing to navigate and shows an error.
A value is required.
Which means the ModelState validating the hidden controls also.
Please suggest how to control it
Instead of hiding it remove the element from the DOM and reinsert it if the first item is selected again. Another way would be to change the name of the input control to something else (a key not present in your model data) when the first item is not selected.
Validating hidden input types is a good thing, i often use them to synchronize data from complex controls (like a treeview with checkboxes). An input type with a hidden css style doesn't make it not submit with the form it belongs too.

Resources