.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

strange behavior on form submit

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net


i have a strange issue happening while submiting a form:

i have this in my form:

<input type="radio" name="type" onclick="document.getElementById('Type').value='Publiser';" />Publisher <br />
<input type="radio" name="type" onclick="document.getElementById('Type').value='Advertiser';" />Advertiser
<%: Html.TextBoxFor(m => m.Type)%>

the javascript is working perfectly and changes the value of the textbox.

the problem happens when i submit the form - what is extracteed by the model from the textbox is the string "on", and after the submit, it also changes the value of the textbox to "on".

when i load the field with a value from the model, it goes ok, and does not change

any ideas?

View Complete Post

More Related Resource Links

Switch views when opening a form depending on submit locations?



I would like to know it was possible to switch views when opening a form depending on where the form has been submitted.

I am submitting my form to library A and library B and want to be able to open it in view 1 in library A and in view 2 in library B.

Is there a way to set some url conditions in the open behavior rules?

Thanks a lot!

Button in a form that does not submit


I've been trying to figure this out all afternoon but my google-fu seems to be failing me. I'm setting up a page with a fairly large form, which has one field that is going to require some kind of popup page that will allow the user to perform a lookup. At the moment I'm only prototyping the page so I'm actually only attempting to a the button up to fire an alert when the button is clicked instead of generating a lookup screen. However it seems that no matter what I do the button causes the form to submit.

I remember one of the very first ASP .NET beginner videos I ever watched went through configuring a button to perform actions without submitting, but I can't seem to figure out which one it was.

Infopath form using Visual Studio - How to bind repeating table on submit button click ?


Hello friends,

   I have created infopath form using Visual Studio 2008

Form have 3 dropdowns and one repeating table which is bound by Datasource ( List from sharepoint ).

whenever i select appropritae values from drop down, Repeating table gets bound as datasource for dropdown and repeating table are same.

I have done conditional formating for repeating table using repeating table properties.


My Question:


Now i included one submit button and i want when i click submit button it will check DropDown Values and if appropriate record matching these values found it will fill repeating table

How i achive this ? as i dont find how to bind repeating table on submit button.

Please help if anyone have answer.


Thanks and Regards,


Kapil Bhosale.




Using ajax to submit and update form


Hi all,

  I'm new to ajax and not sure if it's necessarily the technology I need to accompolish what I'm looking to do. What I'd like to have is a simple two textbox and button form that let's the user submit some credentials (not for logging in) but instead to verify their identity for other purposes.  I would label the button as "Continue" and assuming it passes through, the form would update with some new data entry controls that would allow them to submit some final information.  I thought perhaps ajax would be a nice way to do this since I wouldn't need to create a second continuation page from the first to display a new form.  However, I'm unsure how it's possible to update the form in the first place to look different.  Or is there perhaps a cleaner way to do this?  Any help would be appreciated.  Thanks

Submit a aspx form to a sharepoint list?

Hi,I have a wizard control form in visual studio 2008.. I need to submit this form to a sharepoint list? Is this possible?thanks!

How to submit a form from code behind or something like that

Hi everyone,I dunno what would I do without the forum. I'm stucked again. Basically, what I am trying to figure out something like paypal where we call a specific URL from another web server and give them some information. Basically, I will have a URL like http://www.mysite.com/check_ur_balance.aspx?id=sth&blurblurblur where user call that URL and I query the information from the database and pass it back to the caller site.The flow is something like below:www.client.com  (hey give me this user balance) -> www.mysite.com (I query the user balance and send it back) -> www.client.comPlease help me out. Looking forward to receiving more input on this matter.

Strange Authentication Behavior...

I have an installation of SSRS 2008 that is exhibiting some very odd behavior with regards to authentication and permissions. I have SSRS installed on a box called SERVER1 and I'm a local admin on the box and an Administrator on the SSRS instance. This box has an IP address of When I go to the Report Manager URL, I see everything I should (Home, Site Settings, etc.) I'm able to go in and set up security and create folders and everything. What's odd is that if I use the IP address instead of the server name in the Report Manager URL, I get to the home page but there is nothing displayed, only Home, My Subscriptions, and Help. There are no report folders visible and the options available to admins aren't visible. One thing that may shed some light on things: if I do a ping -a on the IP address, it resolves to the host name. If I ping the host name, I get back a reply from ::1: I have no idea why permissions would differ between a host name and an IP address if they're the same server?? Any insight would be appreciated!A. M. Robinson

InfoPath Form: Encountered error while trying to submit the form from the browser

Hi,I have created a form in InfoPath, and i filled in the form in the browser. But there's an error apppeared when i tried to click on the submit button to submit the form. May i know is there ways for me to check what cause this error because i have no idea about this. "There has been an error while processing the form. There is an unclosed literal string. Line 1, position 543. System.Xml.XmlException: There is an unclosed literal string. Line 1, position 543. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr) at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at Microsoft.Office.InfoPath.Server.Xml.InfoPathXmlDocument.Load(XmlReader reader) at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataObject.<>c__DisplayClass3.<.ctor>b__0() at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.Exception

make anonymous users submit data to a form library

isn't there a way for anonymous users to submit form data to a form library without custom code?

WPF Window as Modal Dialog, strange behavior

Hopefully someone has a clue.... My application displays WPF Window as a modal dialog box. The dialog box has a few child user controls, one of which has combo box. When the user clicks this combo box to select... the whole dialog disappears except of the innards of the combo box. So the user only sees the list box of the combo box. Here are the details I got from the  client: The window itself is launched from non WPF application (Lotus Notes). This happens only on a few machines. The OS is Windows XP SP3. There is no issue with the parent handle, windows owner, etc... I've seen this behavior during the development phase, only when running under a debugger.    Thanks, Michael        

submit infopath 2003 form to a sharepoint list

hi, is it posible to add  an infopath 2003 form to a sharepoint list, not document library but a list. and can i create views from the infopath 2003 form?

InfoPath form web part stops the close on submit

I have successfully published HTML browser enabled InfoPath 2010 forms to form libraries in SharePoint 2010. Users can navigate to the libraries and click new docuiment and fill out and submit forms, and the behavior of submit is as programmed in the form namely I have a concat rule for form name and chose action after submit to close the form with a success message. The problem I am seeing is a little abstract so stay with me while I explain. I'm hosting a number links to web part pages with the infopath web part on them. I use a links web part to aggrigate about 16 forms links on a single page. Users can successfully click on a link, are migrated to the web part page that has the form displayed in the infopath web part and all is well till they click the submit (on the ribbon, or custom button or whatever) The form does successfully get saved into the form library, but the form does not close. I need to make this process very simple for users without any training expended on the process. I'd like to shift focus to the previous web page, or close the form or something dramatic visually to show the user that they have completed the form fill out, and allow them to fill another form. Codebehind examples gratefully accepted! /Robin    

Validation.Error giving strange behavior

I'm seeing some weird behavior with the Validation.Error attached event. I have a textbox bound to an object that implements the IDataErrorInfo interface. The textbox subscribes to the Validation.Error event. What is weird is that when you put the text box into an invalid state, the Validation.Error event gets triggered twice. Under .NET 3.5, the first time ValidationErrorEventArgs.Action == Removed. The second time ValidationErrorEventArgs.Action == Added. Under .NET 4, it's reversed. The first time ValidationErrorEventArgs.Action == Added. The second time ValidationErrorEventArgs.Action == Removed. Why would it be called twice and why would it work differently under .NET 3.5 and .NET 4? I'm trying to implement a validation summary control similar to the one from ASP.NET. There is a solution here: http://codeblitz.wordpress.com/2009/05/12/wpf-validation-summary-control/ but it doesn't work under .NET 4 because in order for it work work, when you put a control into an invalid state, the last call to the Validation.Error event has to be with ValidationErrorEventArgs.Action == Added. Here is my code:   <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplicatio

How to submit my form to Sharepoint Library as well as Sharepoint List with specific Fields only.

Hello ,   I have a Infopath form that contain 50 of fields. i want to submit those form into sharepoint library as well as Sharepoint Custom List(Specific Fields). Please suggest best practice to develop such a functionality.   Thank you.

Error submitting browser enabled form using this.Submit()

I'm trying to submit my Infopath form by calling this.Submit() method from my button click event handler.  According to Microsoft - Note: You can write a custom submit event handler for the Submit event, and then you can programmatically call the event handler by using the Submit method. This type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser. Its not working for me and throws this exception  - XmlForm.Submit cannot be called from the SubmitEventHandler. BTW - I'm able to submit same form without any problem if I don't use this "Submit()" method.  I really want to know why its behaving like this.  Looks like a BUG.  Thanks, Suhaib Khan

ListBox.SelectedItem stuck at whatever is first selected and other strange ListBox behavior

Hi, I've built a List<Participant> (Participant being my custom type) and assigned this to ListBox.ItemsSource. (I'm aware this is more the Windows Forms way than the WPF way of databinding, but I'd still like to understand what's going on here - even though suggestions on how to perform my task in a more WPF-y way are also welcome.) I've set ListBox.SelectionMode to Single, and attached an event handler to the SelectionChanged event. In this handler, I dump the SelectedIndex and SelectedItem to debug output. Contrary to my expectation, 1) SelectedIndex is always -1. This isn't really causing me any trouble, but it's certainly not what I'd expect. 2) SelectedItem refers to the correct object the first time (in the windows lifetime) I select an item, but then keeps referring to this first-selected item regardless of whether I deselect (by clicking the item again while holding down the CTRL key) or select some other item. 3) If I keep clicking around and scrolling a bit (the list has ~320 items) within the list, now and then the list suddenly displays a bunch of items - sometimes many in a row, sometimes non-contiguous items, but it seems always "nearby" items! - as if they were selected. The list keeps firing the SelectionChanged event, but SelectedIndex is forever -1 and SelectedItem (and SelectedValue) always refers to whatever I had selected the fir
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend