how to post/submit form values on textbox focus out event in asp.net mvc2 with out Jquery? - asp.net-mvc-2

I have two text boxes using Html.TextboxFor() helper. When I type values in Textbox1 and click outside (moving out the cursor from the textbox), TextBox2 should be populated with TextBox2.
I am aware of that using Javascript/Jquery, fill the values, but i don't an option use any of the client side script.
So I have to post the form values to controller action method & fill Textbox1 values with TextBox2 using model object.
how to post/submit form values on textbox focus out event in asp.net mvc2 with out Jquery?

how to post/submit form values on textbox focus out event in asp.net mvc2 with out Jquery?
Perfectly impossible without javascript. You need to subscribe to the onchange event of the first textbox and then trigger the form submission (once again using javascript).
If you cannot use javascript, your only option is to have a submit button on the form that the will submit the form and the corresponding text values once the user clicks on it.

Related

How to add Custom Keystroke event for a combobox using Itextsharp and Javascript?

I have a pdf form , and I dynamically add a combo box to this existing pdf form using Itextsharp.
On the change event of the combo box, I need to update the selected value of combo box to a text field.
This is the script I need to add to the custom keystroke event of the combo box.
if (!event.willCommit){this.getField("TR6").value=event.changeEx}
Is there any way to add this script via Itextsharp.

Symfony 2 form and tab

I am new to Symfony framework. The issue i have is with form.
I managed to get data from the database and wrap it into one element and display it to the popup window. from the pop-up window only the selected items should be save on the tab which I was able to execute it using jquery.
I question is how to i save the elements from the html to the database?

use one text box with multiple form submit buttons ruby on rails

I'm making an app where I have multiple forms on one page but they are all similar; there is a text box and a submit button.
What I would like to do is consolidate all text boxes into one then have many submit buttons. That way the user inputs the data once in the obvious text box at top then decides which category (submit button) he would like to apply the data in the input box to.
Is this possible? I can't find and documentation on how to do this. Thanks!
You can do so by using <%= fomr_tag url: "/myCust" do %> method to create a form and wrap all the fields inside form tag. on submit button you will be redirect to /myCust method.
There you can get all the params in myCust method. You are using rails 4 then define all params under private method as it does. Store each of them. as you may want.

Enable 'submit' button only if a value in the form has been changed

I have a php form for a website containing text fields which display values retrieved from my database and also a submit button. I would like the submit button to be disabled by default and to only be clickable if the user has made a change to one of the text fields in the form. However if they were to change it back to the default value, the button would automatically be disabled again. Any help is appreciated.
You need to use javascript. For each field, you must make a eventhandler that checks the value and then enables or disables your submit-button.
Declare a Variables for each Text box
Then assign the values that you Retrieving from database to the text box and a Variables...
At the time of Button_Click compare the Value of text box with the Variables
If BOTH are Same then there is no EDIT's occur
That's all

AutoComplete does not save when there's a postback before Submit

I have a very simple asp.net form.
a text box,
a dropdownlist with autopostback,
a submit button
now if i type in some value into the textbox
and then select an item in the dropdown which causes a page postback.
then click on submit button
the value in the text box does not get saved into the autocomplete data store.
if i do the opposite.
select an item from the dropdown which will cause a page postback.
type in some values in the textbox.
click submit.
the value is saved for the autocomplete.
I think this may have something to do with the page life cycle and the viewstate. but how do i get around this issue? I'm using IE8.
I have tried the AutoCompleteSaveForm command. but it does not work if there's a postback immediately after the execution of it.
Use this for IE:
if($.browser.msie){window.external.AutoCompleteSaveForm(FormName)};
It does not work for Firefox and I'm trying to find the answer for that....