Client Side HTML Radio Buttons not Posting with Server Side Form

I have a server side form that is posting when an HTML client side button is clicked.  However, the value of my html client side radio button is null when I call Request.Form("htmlradiobuttonlist") on the resulting page.  Does anyone know why the form won't the post the value?  Please help!  Thanks in advance.

I'm still using dot net 1.1.  I can use server side buttons or server side radio buttons.  I can explain why if necessary.

Below, you can see the HTML radio buttons in the datalist.  The JS function works, but is omitted from below.

<form id="form1" action="download.aspx" method="post" runat="server">
        <table width="993" border="0">
            <tbody>
                <tr bordercolor="#3">
                    <td width="799">
                        <asp:datalist id="DataList1" runat="server" OnSelectedIndexChanged="OnSelectIndexChanged">
                            <ItemTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:ImageButton ID="ExpandButton" runat="server" ImageUrl="images/plus.gif" CommandName="Select" AlternateText="Click here to see details"></asp:ImageButton>
                                        </td>
                                        <td class="Head03AlertRed">
                                            <%# Container.DataItem %>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>
                                            <asp:datalist Visible="false" id="Datalist2" runat="server">
                                                <ItemTemplate>
                                                    <table>
                                                        <tr>
                                                            <td class="Headline">
                                                                <input type="radio" name="htmlradiobuttonlist" value='<%# Container.DataItem("value") %>' />
                                                                <%# Container.DataItem("name") %>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </asp:datalist>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:datalist>
                        <p>
                        </p>
                        <div align="center">
                            <input class="FormButtonWide" onclick="return radio_button_checker()" type="button" value="Continue" text="Continue" />
                            
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
0
jhoppe2
11/29/2005 6:46:47 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

3 Replies
1641 Views

Similar Articles

[PageSpeed] 6

It worked for me, though I noticed that you added the action attribute to your <form> tag. Could be that's your problem. Here's what I did:

<form id="Form1" method="post" runat="server">

            <asp:Button id="Button1" runat="server" Text="Button"></asp:Button>

            <input type="radio" id="htmlRadioButtonList" name="htmlRadioButtonList">

</form>

 

private void Page_Load(object sender, System.EventArgs e)

{

            if ( this.IsPostBack )

            {

this.Response.Write("htmlRadioButtonList: " + this.Request["htmlRadioButtonList"] + "<br>");

            }

}

NC...

0
NC01
11/29/2005 8:22:17 PM

Ok, I made a mistake in my original post.  I meant to say:

"I CAN'T use server side buttons or server side radio buttons.  I can explain why if necessary."

I have the same problem when I use your code with an HTML button.  Any other ideas?

--Sorry about the typo.
--Joe

0
jhoppe2
12/1/2005 6:04:34 PM

No, since what I posted earlier works for me.

As far as I know, you cannot have the action attribute set on an ASP.NET <form> element, since ASP.NET's design forces the page to post back to itself. When I added it into my test page, it broke the page.

NC...

 

 

0
NC01
12/2/2005 12:18:21 PM
Reply:

Similar Artilces:

How to Access/Pass Server Side Array Variable at Another Web Form's Client Side
Hi All,I struck up with some intrested senario at my application development...hope some body will guide me or sends me some code snippets....Thanks in advance.Senario is like this.....in A.aspx (using C# .net 2.0 as code behind) I am going to have a array variable basically it is an TWO Dimensional array after populating the values in array I need to redirect/ reload another web form B.aspx, here i need to access the array in B.aspx client side JavaScript.How can I do this...Thanks AgainRaju Dont do a redirect but use server.transfer. That way the previous page will still hold its value, ...

Firing both Client side event and server side event for server side button
I am having some difficulties getting this to work.. I have button_click (Asp.net) and ClientClick (Javascript).  Javascript is firing fine.  Server script is not. may be you have return return false in the in the javascript which is why its not firing server side event.You should add javascript evelt like thisbutton1.onclientclick = "functionname" Function should nopt return false. Vikram www.vikramlakhotia.comPlease mark the answer if it helped you...

form double validation- server side and client side
Hi! I would like to make a server side validation after calling a js function that makes the client-side validation. I do not understand couple of things: 1. Do i need a server side button or  a simple HTML submit button in order to call both of the tests? 2. How do i call a server side function which is written in csharp  after i finish my JS validation (the submit  button is calling the JS function for validation first.)- is it possible to call it directly from a js function? 3. I know that my toolbox on asp.net  contains validation controls who probably are b...

web forms with client and server side controls??
Hi, I have a form that has client and server side controls. I have a problem in that any client controls (textbox) within the form runat="server" can not be accessed with client side code. Anyone got any ideas why and what work arounds are possible. Regards, Graham. once a form element is inside a <FORM> tag, you can no longer refer to it by its ID alone. you have to refer to it by formname.elementid or document.all.elementid. use document.getElementById(yourtextboxid) to get a ref to the element in the form. using this allows u to bypass the formn...

Client-side call from server-side form... anyone, anyone, Bueller?
I'm hoping someone can help me here, I am about at my wits end.   I am a part of a team building a rather rich web app that requires multiple possibilities as to the form layout.   Right now, we are using javascript to dynamically build the form according to the needs of the "search" that is being created.   i.e., one person with one house, two people with one house, three people two houses, all dynamically created by the user as they are creating the search.   Obviously depending on how the search form has been created there would be any...

server side controls in a non-server side form
I want to use server side controls in a non-server side form.I use server side controls (like dropdownlists) so I can fill them with the right options from the database.My question is, what is the best way to approach this?CAN I use server-side controls in a client side form? If so, how can I get the values contained in the controls when I do a post? (not in a querystring).Here's a sample of my code: <form id="frmAdvancedSearch" method="post" action="advancedSearch.aspx"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <input type="submit" /> </form>...

Convert this form to a server-side form?
I've got a standard HTML form that's used to redirect to PayPal's website for credit card processing, and the form contains hidden fields that contain values such as the order total, currency format, etc. However, I need to know how to send this information to PayPal's website by using an Image Button Web Control, rather than using the form that PayPal provides. Is there a way to do this? Here is what the form looks like... <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd"...

pls help: how to get client-side HTML "text field" value from a server side button
i copy some javascript from somewhere so user can choose pick up a date from a calendar and display the date onto a HTML text field. I have no knowledge in writing client side script(i.e. write code in html) can i write some code in a server-side button to get the value in the HTML text field??? i tried: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click textbox1.text = document.getElementById("htmltext").value End Sub but "document" is highlighted, and say isn't declar yet. and...

Access web form content from client side HTML file using javascript
I have two browser windows open, one an html file residing on the client and one an aspx page served up by the web server. Neither window is related to the other; neither one opened the other. Is it possible for javascript on the html file which resides on the user's local computer to "read" any of the information from the other open window? Ideally, I'd like to read a hidden input field from the web page. The solution only has to work in IE 6 and 7. Thanks in advance. Man, this sounds more like a virus, like spyware... Why do you need to do such thing? What I want is to open ne...

differences between server side asynchronous Web methods and client side asynchronous Web methods
Hi,   can anyone expalin what are the differences between server side asynchronous Web methods  and client side asynchronous Web methods in ASP.Net 2.0 ?   any best articles on serverside asynchronous Web methods  ?   Thanks,  hi, check this url, Server-Side Asynchronous Methods for ASP.NET, http://www.codeproject.com/KB/cpp/asyncws.aspx   Calling the Server-Side method asynchronously from Client Script, http://www.c-sharpcorner.com/UploadFile/dipenlama22/Callbacks07182006093320AM/Callbacks.aspx...

Conditional Client Side and Server Side call same button
I have a submit button on a form that I want to first do the validation and if valid call a client side javascript function and then run through its click event handler currently I have this set up by adding this line in the Page_Loadmybutton.Attributes.Add("onclick", "javascript:ShowRunningDialog(this);");But if the page is not valid I don't want to call this client side function. As it is now the 'ShowRunningDialog' is obviously going to be called no matter what     if (Page.IsValid) mybutton.Attributes.Add("onclick", &qu...

Jscript, moving from client-side to server-side (.NET)
Hey all I’m working translating a web-app written in client-side Jscript to run on the server-side as JScript.NET. Without needing to get too specific, I am using Jscript because the original page aggregated raw data to produce statistical results (this was done dynamically based on user 'sort-by' options). The final output is an html report that can be emailed. Because this is currently being done on the client side, as the raw data grows the load-time grows as well (to the point that has almost become unusable). I’m posting here to see if anyone has any experi...

Validation Controls in .NET ( Client side or server side?)
 i have a very basic question. We have all these validation controls in asp.net ( required field, range validator and others)..my question is the required field validator is a server side control. So does that mean that it does a post back?..is it client side or server side control  The only controls that post back are buttons and other inputs where you set AutoPostback="True", such as a dropdownlist or a textbox.  Another way of posting back is using an UpdatePanel and placing a trigger in it for a specified control and/or event. All controls are considered clien...

working on a web form how to have two datagrid side by side
curretly started to work with the web developer express, in the form when I am trying to design a form and trying to have two data controls side by side, the later one move under the first one. But what I am trying to accomplish is that I want both of them side by side  for example  "a|a"   here "a" is next to "a" not underneath.  sure there must be lot of help. : )  always learning little things to be big If I understood what you need the solution is simple HTML: <table>       <TR>      &n...

Web resources about - Client Side HTML Radio Buttons not Posting with Server Side Form - asp.net.web-forms

Button - Wikipedia, the free encyclopedia
In modern clothing and fashion design , a button is a small fastener , now most commonly made of plastic , but also frequently of metal, wood ...

50,000 Websites Add Facebook's Like Button And Social Plugins In First Week
50,000 Websites Add Facebook's Like Button And Social Plugins In First Week

Feature Request: iCloud Photo Library needs a purge downloads button à la Google Photos
... but it’s not perfect at knowing. Google Photos (which is free but uses its own app) takes a different approach by putting a great big button ...

Twitter Launches Conversational Ads: Tweets With Call-to-Action Buttons
... ads. Similar to its poll feature , this ad format allows users to engage with the sponsored tweet via custom hashtags or call-to-action buttons ...

Push our Buttons
For whatever it's worth, we have brought back our Twitter and Facebook buttons. Please use them if that is something you like to do. We get ...

Say ‘so long’ to the shutter button with the Selfie Stick app
... more people or surroundings in their shots. A new app called Selfie Stick is a tool that lets you take a selfie without hitting any buttons, ...

Withings expands fitness family with button-sized, e-ink Go tracker
The $69 device is the company's least expensive and most versatile tracker.

$15 screen protector adds an invisible back button to your iPhone
This is one you have to see to believe. How many times have you wished that there was a physical back button on the bottom of your iPhone? Instead ...

Intel shows how this button-sized chip could revolutionize live sports
... its CEO Brian Krzanich on-stage for its keynote speech earlier this week. The action-packed performance was done to showcase its new button-sized ...

Whirlpool’s “Smart” Appliances Now Come Equipped With Amazon Dash Buttons
When Amazon introduced the Dash Button, it claimed customers could easily reorder products with the simple push of a button . While the small ...

Resources last updated: 1/20/2016 11:35:47 PM