Passing Parameter From Radio Button & Check Box To Email?
Mar 21, 2011
I have a form that is HTML, it involves a few string questions, a radio button, and a check box question. After the form is filled out, the info is then passed to an aspx page which sends out an email with the info. I am able to pass the string questions to the email, but am having trouble passing the radio button answer and the check box answers to the aspx and to then to the email. I have the code for the HTML set, I need help with the code for the ASPX page.(it is VB) Here is the code I have so far.
HTML
<form id="form" method="post" action="SendEmail.aspx" enctype="multipart/form-data" name="questions">
<div class="Qblock">Name: <input type="text" class="input" value="" name="contact_name" /></div>
<div class="Qblock">Phone #: <input type="text" class="input" value="" name="contact_phone" /></div>
<div class="Qblock">E-Mail: <input type="text" class="input" value="" name="contact_email" /></div>
<div class="Qblock">How many years have you been in this industry?<input type="text" class="input" value="" name="contact_long" /></div>
<div class="Qblock">What is your specialty?<input type="text" class="input" value="" name="contact_special" /></div>
<div class="Qblock">Do you have a cell phone?
<input type="radio" name="P1" value="Yes" /> Yes <input type="radio" name="p1" value="No" /> No <br /></div>
<div class="Qblock">Can you do any of the following? (check all that apply)<br />
<input type="checkbox" name="ckBox" value="CustSer" /> Handle Customer Service<br />
<input type="checkbox" name="ckBox" value="ReadForm" /> Read Expense Reports<br />
<input type="checkbox" name="ckBox" value="NewCust" /> Sign Up New Customers<br /></div>
ASPX
Protected Sub RetrieveValues()
Dim sTemp As String = String.Empty
sFromName = "[URL]"
sToName = "[URL]"
sSubject = "Web - Contact Us Inquiry"
sTemp = String.Format("{0}{1}{2}", "<<< Marketing Opportunities >>>", vbCrLf, vbCrLf)
sTemp = String.Format("{0}{1}{2}{3}", sTemp, "Name: ", Request.Params("contact_name"), vbCrLf)
sTemp = String.Format("{0}{1}{2}{3}", sTemp, "Phone: ", Request.Params("contact_phone"), vbCrLf)
sTemp = String.Format("{0}{1}{2}{3}", sTemp, "Email: ", Request.Params("contact_email"), vbCrLf)
sTemp = String.Format("{0}{1}{2}{3}", sTemp, "How many years have you been in this industry? ", Request.Params("contact_long"), vbCrLf)
sTemp = String.Format("{0}{1}{2}{3}", sTemp, "What is your specialty? ", Request.Params("contact_special"), vbCrLf)
End Sub
each of them is a check box inside this check box list and i have a stored proc that takes paramter which is the name of the city and gives me a data according to the name of the city (Filter). i wana know if i checkec more that one city how can i pass this to the stored proc eg if i checked on cairo and alex what can i do to make the filter looks like this where city Like 'Cairo' and City Like 'Alex' My Stored Proc takes @City Parameter like this Create Proc xx(@City varchar(2)) how can i pass the 2 cities 2 the stored proc
i have a Radio button i html table via System.Web.UI.WebControls. in the first colom is the Radio Button , and checkbox in each colom to the right, what i want is when i click the radio button it should check all the checkboxes
I'm fairly new to MVC and admittedly don't fully understand how data is passed between Views and Controllers. That said, here is my issue.
I am working with C#. I have a page which has a list of items. Each item has a radio button set of three associated with it and there are 15 of these sets on the page. Thus I have radio1, radio2....radio15, etc. Each of these has value 0, 1, or 2 upon submit. I can't seem to understand how to get the information out of these radio button sets from the controller without passing 15 different variables to the post method in the controller which is associated with the view; ie passing Int32 radio1, Int32 radio2,.., Int32 radio15, etc.
I tried using ViewData["radio"+i] in a loop to access the value of each radio button set, but this, apparently can only be used to pass data to the View from the Controller and not the other way around.
I want build a page tha have a panel or web part or div with controls within (like radio button,check bok, botton...) and I want to drag an drop want of this control to the other web part, panel or div and know after it what control I moved there.
I am looping through all the posted data on my website and grabbing the values, this will then be used later on. The user is going to put 2 radio buttons on the page, one with a correct answer and one with an incorrect answer. I need to know how to see if a Radio Button is checked or not based on the posted data.
I have string which came from the database,now i want to compare each charater of the string with the radiobuttonlist value and check box list value and select both radiobutton list and checkboxlist.
Here i write down some code but its just select 2 item of the each radiobuttonlist and checked all checkboxlist.
i have total of 20 questions in my sql table, it is consist of 2 type of questions: 1. Single answer -- the question that have only one answer. 2. Multiple answer -- the question that have multiple answer.
Using DataList( or another possible ways) how do i manage to show radio button for Single choice, Check box for Multiple choice question ?
I've two radio buttons in my web site for selecting sex, one s for Male & another s for Female, Problem is during the Run time, I was able to select both the Radio Buttons, but as per my need i should select only one radio button. And i should perform validation Wn user not selected even one radio button i should show the error msg, like " select sex "
how do i go about looping through each group of radio buttons and getting the text of the selected radio button ?the code displayed above is created dynamically ... in my aspx file i have the following code
Using jQuery I want to be able to click an element which will also checks it's related radio button. I had this working fine until we had to add runat="server" to the radio buttons.When I apply this it prevents my jQuery function from working how to get round it, heres a simplified version of the code:HTML
I've found out that when its converted to a .net control instead of checked="checked" (as it would be usually) it is just Checked, so I changed that but on inspecting the DOM in multiple browsers, none of my radio buttons are being checked(Are there any other ways I can use jQuery to check a radio button that has runat="server"?
I have the following code<asp:RadioButton runat="server" Text="Male"></asp:RadioButton>I want a gap between the radio button and the radio button text, I made the following changes in the text field(prefixed a space) Text=" Male". However, I don't feel this is the most efficient way.
I have a web application that shows a page containing between 6 and 20 AJAX UpdatePanels, contained with Custom Web (.ascx) Controls.
You can see an example of such a page here:
[URL]
The problem I'm getting is that when the user FIRST clicks any of the radio-buttons on any of the controls in the page, ALL the radio buttons that have an active selection ALSO fire an rb_CheckChanged event (see application log below). On subsequent radio-button clicks, only that RB fires the event (as expected).
This behaviour is having a dramatic impact on performance. The page loads quickly, and a "normal" RB click provides an AJAX update correctly within 1 second. The problematic first RB click, however, takes up to SIX seconds to process, which is unacceptable from a user experience standpoint.
Developed in VS.NET 2008, ASP.NET 3.5. Also I converted the "Web Site" solution to a "Web Application" (pre-compiled) and got the same performance (still too slow). Release builds run only marginally faster than debug builds.
Why would a single RB selection change cause all RB's that have a "selection" set on them to also fire? (The "selection" is determined through database settings every time the control is populated, which is called from within the parent page control's Page_Load function. This selection is determined also at first page load, since all the controls get populated then, so why would the clicking of an RB cause them all to fire an event, and only once? That's what I don't get...)
Not sure if this is an AJAX issue, or general ASP.NET UI issue, so I'm posting in two forums on this one.
In addition to the process of regex syntax validation of Email Addresses entered by users, I'm trying to check if the entered email address is a real one and does exist?The best I could achieve is to "Ping" the host the email address is associated with. But there are some other terms in the industry like Handshaking with Email Server, etc.not necessarily with 100% confirmation accurary!
I have 3 tabs with 3 seperate gridview and radios buttons in them. Each page has a seperate submit button, but for some reason each pages submit button is validating all the radio buttons on each tab, i picked the seperate controls to validate under but on any submit theya re all validated instead of just the ones on that tab.
I have a databound Gridview (with a LINQ datasource). The gridview displays questions from the SQL DB to the user. I've inserted a radio button list into the gridview with 3 horizontal radio buttons with fixed values of 1,2,3 for the user to select. I have a question ID, a tempuserID, and AnswerValue columns set up in the database. It all works nicely.
After the user selects radio buttons, I would like for them to push a button to submit the QuestionID, the associated Radio Button Value (AnswerValue) and their tempUserID into the DB. How do I do this? I'm not sure what to do next and what VB/LINQ code to put in the code behind file in the button click event handler. I'm also not sure on what to use for the tempUserID, can I use the sessionID? I'm using VB and here's my code:
i have a UP and DOWN buttons ouside a gridview and a checkbox inside the templated field .I will check the checkbox to sleect a row , after that if i click on UP button the checkbox above the selected checkbox should be selected.
same with when i click on DOWN button the checkbox below the selected checkbox should be selected.
Secondly, how does ASP.NET MVC know that action is my action, and controller is my controller. Like I saw this in samples, and it does work, but isn't it just an anonymous object with no type?