Edit A Form - Retrieve Values From Db And Set Checkboxes To Reflect Value
I have a feedback form which user completes and data is submitted to db. I then want to allow user to edit this form so I retrieve values from db and populate the textboxes. This is working fine. My question is how do I set checkboxes and radio buttons to reflect these values?
It must be something like 'if value is ?? then check the box', but what is the correct syntax and is this code placed within the actual radio box/checkbox?
ie. Radio: <input type="radio" name="Gender" <%if strGender = "1" then value="Check Checkbox" %> />Male
Checkbox Mail <input type="checkbox" name="ReceiveInfoByMail" value="<%=strReceiveInfoByMail%>" />
View Replies
ADVERTISEMENT
I have a form to edit my database. I coded the post form fine. But I have never had to pull from the database and populate checkboxes (The ones check on the post form). I have no idea where to start. Here is the code from the post form: Code:
View Replies
View Related
I have a form which allows a user to select a 'commencement date' using separate day, month and year drop downs. The date is then submitted to db in DDMMYYYY format(as required).
I now need to allow user to edit this date if they need to. So, I retrieve the date from db as ie. 30101968. I now need to place the first 2 digits (30) into strDay, second 2 digits into strMonth and last 4 into strYears so that I can reflect these values in the their relevant drop downs.
Does anyone know how to 'grab' those specific values?
View Replies
View Related
I'm trying to setup something that adds/edits records to an access db using vbscript.
I've got an html form with text, select and textarea inputs.
These values get passed to an asp page that UPDATES the record (not INSERT because it's actually appending to an existing record). Because this page is also an EDIT page, I SELECT all the values so as to:
1) display the current value for editing
2) make sure if they're not edited the value is not null when submitted
My questions:
It's no problem populating the values of form "text" inputs, but how do I do the same for
a) the "select" inputs (Make the proper value SELECTED)? and
b) the textarea input?
ie. The user goes to the page for the first time and there aren't any values yet. They use the various form inputs to add values. When they come back to edit the same record I need to display current values of all form fields properly. Code:
View Replies
View Related
I have a form that is dynamically generated since it is populated with values retrieved from a database. The form can of course also be submitted, which is where I run into some problems.
Since I never know in advance what the length of the form (or for that matter what the different elements' names and values) will be I don't know how to write the code in "receive.asp" to retrieve all values from the form correctly without excess use of "request.....".
I shouldn't have to write requests for every single potential element name that is stored in the DB. Please note that the form can sometimes also contain radio buttons and check boxes, even though they are not present in this short example Code:
View Replies
View Related
if i have a vbscript function on a certain form and I assigned some values on an array variable on that function, is there a way for me to retrieve the values of that array on another asp page once i submitted the form?
View Replies
View Related
I am generating between 5 - 15 dynamic checkboxes in a specific database search. The user will at most only select 1-2, maybe 3 checkboxes at a time. Through a form, i want to find out what checkboxes were clicked and get the value contained in the checkbox.
Can any of you suggest a suitable method of doing it? i assume i'd be using a 'for' loop, if i can get a foot up on how i'd go about doing this
View Replies
View Related
I have a form that users use to register with the site. On this form there are checkboxes all with the same name but different values. I am creating another page that will allow users to login and edit their information.
Since all the data from the checkboxes are stored on the database under the same field name and separated by commas; how do I dynamically create a set of the checked checkboxes that the user originally entered along with the other checkboxes the user did not click?
View Replies
View Related
I have some problems in trying to retrive multiple parameters from a stored procedure. When i want to just get one i use
select @param AS 'para'
But how should i do when i want multiple parameters out to the ASP files?
View Replies
View Related
I have a form which I would like to allow a customer to edit/update. I need to populate the text boxes with retrieved data and then allow customer to select 'update' button. I can't figure out the syntax to place the retrieved value within an input box.
I have this so far, which obviously doesn't work - double quotes etc. Tried double and single quotes but no value appears.
Also tried placing retrieved value within variable, but didn';t work either.
<input type="text" name="FirstName" value="<%=rsdetails("FirstName")%>"
View Replies
View Related
I'm sure questions like this irritate the hell out of experts but I'm more designer than programmer. Please could someone help me to create a form that will allow users to tick check boxes then have this info sent to an email address. I've managed to create text fields that work (which is a miracle in itself) but check boxes have me stumped.
I have an asp server script called confirmation.asp
<%
DIM strEmail, strName, strAddress, strTel, strMobile, strTrade, strCurrent, strRenewal, mail, reply, objMail
strEmail = request.form("Email")
strName = request.form("Name")
strAddress = request.form("Address")
strTel = request.form("Tel")
strMobile = request.form("Mobile")
strTrade = request.form("Trade")
strCurrent = request.form("Current")
strRenewal = request.form("Renewal")
mail = "email@email.com"
reply = request.form("Email")
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = reply
objMail.Subject = "FM Green Insurance Request"
objMail.To = mail
objMail.Body = "Email: " & strEmail & vbCrLf & _
"Name: " & strName & vbCrLf & _
"Tel: " & strTel & vbCrLf & _
"Mobile: " & strMobile & vbCrLf & _
"Trade: " & strTrade & vbCrLf & _
"Current: " & strCurrent & vbCrLf & _
"Renewal: " & strRenewal & vbCrLf & _
"Address: " & vbCrLf & strAddress
objMail.Send
Set objMail = nothing
%>
and fields like this on my form
<td>Email: </td>
<td><input type="text" name="Email" id="Email" size="50" /></td>
</tr>......
View Replies
View Related
I want to loop through some checkboxes & extract their name & value. actually i want an if statement that says if they are empty write nothing & if they arent then extract name & value of checkbox.
i know how to do the if & extract the values etc but not the loop. at the moment i have really long code that looks at each checkbox tests if its empty & if it isnt then extracts the values I need. Code:
View Replies
View Related
have 6 checkboxes on the form i want the user to select 3 of them if the user doesnt select any of them fire an alert if the user selects 3 of them then only submit the form if the user selects 5 of them fire an alert telling him he has to select only 3 same thing applies if he selects 2 checkboxes tell him to select 3
here is the code i have written and its not working ...
View Replies
View Related
I have an aspx page that contains an include section which calls an html
page for text to be displayed on the aspx page. I also have an upload page
that allows users to upload a simple html page with the same name everytime
and places it on the server. My problem is that the aspx page does not update
to reflect the changes made to the uploaded html page. However, if I log into
the server and open the aspx page that contains the code and hit save then it
updates and shows the changes. Can anyone help me correct this problem? I am
not for sure if there is code out there to update this automaticly or what I
can do.
View Replies
View Related
I want to call a recordset so you can edit the details and then obviously pass the parameters onwards into the db. However, the user guide just says this:
To process other fields in the form, use the Form collection of the upload object the same way you would use the Form collection of the Request object. For example, if your form had a text element named UserName, your processing code would include: Code:
View Replies
View Related
I'm trying to retrieve the name of a textfield, instead of it's value. I'm using a html page with a very simple form, containing 8 textfields. When submitted I call an asp page, and from that page I want to retrieve the textfield names from the submitted form.
Does anybody have an idea how the do this? It's for entering value's into an xml file and i want to use the textfield name's for naming the new xml elements.
View Replies
View Related
What I want to do is that I have created text box on one form so whenever user type something init and click search button then I want to display that text box value on other form so that i can retrieve a record according to that user's number... Code:
View Replies
View Related
I can get all fields, but how do I not get the button in the loop
Dim FormFields
Set FormFields = request.form
Dim Field
if request.form("Button2") = "Update Order" then
For each Field in FormFields
response.write Field & " = " & Request.Form(Field) & "<br>"
Next
end if
View Replies
View Related
I just inhereted a website. I made a change to a simple SQL string in a ..aspx.vb page. If I don't have Visual Studio, is there a way to "publish" the pages and show my changes?
View Replies
View Related
I'm trying to retrieve a certain string within a form. The string starts with an unique 4 character identifier, but then is followed by 5 numbers that is not constant.
Example strings:
wxyz51268
wxyz98547
So the string will always be 9 characters in length and start with the "wxyz".
View Replies
View Related
I have some code in my form as follows, to display 1 to 20 additional sets of fields to enter guest information. I am not sure how to retrieve these guests info so that I can post the info on an email such as:
Additional Guest 1
First Name =
Last Name =
Additional Guest 2
First Name =
Last Name =
i.e. The 'First Name' for guest 1 is name="AG_fn<%=x%>" The code loops through depending how many sets of fields were completed.
View Replies
View Related
I have a form on an ASP page that has 5 text boxes, for data entry. I am trying to get data from the text box, and pass it to a hidden text box on the form.
The hidden text box is called "MyDateTime" (a SQL date and time value). I am attempting to concatenate data from two other textboxes (one for date and one for time) to give a string like : "8/8/2004 8:00 AM" I am trying to use the following: Code:
View Replies
View Related
<%@Language=VBScript %>
<%option explicit%>
<%
MESSAGE = (Request.Form("type"))
MESSAGE=MESSAGE & vbcrlf & "Name" & (Request.Form("name"))
MESSAGE=MESSAGE & vbcrlf & (Request.Form("address"))
MESSAGE=MESSAGE & vbcrlf & (Request.Form("handphone"))
MESSAGE=MESSAGE & vbcrlf & (Request.Form("phonenumber"))
MESSAGE=MESSAGE & vbcrlf & vbcrlf & (Request.Form("comments"))
MESSAGE=MESSAGE & vbcrlf & vbcrlf
MESSAGE=MESSAGE & "____________________________________________"
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From =Request.Form(email)
objMail.To = "icepricessa@hotmail.com"
objMail.Subject = "Business/Career Enquiries"
objMail.Body = ""&MESSAGE&""
objMail.Send
Set objMail = Nothing
%>
but somehow i'm not able to send the mail....
View Replies
View Related
I have the following line of code in my asp page:
Dim ix
For ix = 1 to Request.Form.Count
fieldName = Request.Form.Key(ix)
fieldValue = Request.Form.Item(ix)
Response.Write fieldName
Response.Write fieldValue &
Next
Response.End
It is not returning the results of any field on the previous form page.
Does anyone know what I might look for?
View Replies
View Related
How can I getting parameter values from more than 1 HTML form onto the same ASP page?
View Replies
View Related
put the ASP part where Page 3-Displaying form values from one page on another
View Replies
View Related
we have a web system whena user submits a form, it's take to a page... if the user didn't fill in a particular form properly then resulting page tells them so. they then go back and fill in the remaining fields.this works for all but 1 user whose values disppear totally, having to do it all again.has he got his computer set up differently?
View Replies
View Related
I have created a asp page "AddUsers.asp" which allows the admin to create new user ids.The admin fills in all relevant details and clicks on submit.The form gets posted to a page "Insertusers.asp" which checks if the new entered userid already exists in a database.
If the userid already exists, page display a message saying "Userid already exists" and a back button(link to Addusers.asp).When the admin clicks on back button, it takes him to Addusers.asp and all the relevant details entered in a form are lost.Again he has to fill in all the details which i want to avoid.How can i retain the values entered in the form so that the admin can change only the userid and submit the form again?
View Replies
View Related
I have a problem where form values go missing. The are several forms on one page with indivdual names (i.e. form1, form2) but with the same fields. Whenever the form is submitted via post the values disappear. It only happens on this one particular page.
The odd thing is that if I do a response.write with the variable and then a response.end write after it it shows up perfectly. The page is just a basic record update page. If I do a response.flush() it works as well (up until the redirect). I am leaning towards a response buffer problem but still don't understand why it is happening.
View Replies
View Related
I came up with the new problem. I want to fetch all form values by using request.form("FormName") which is generated by javascript on runtime.
The attached zip code contains the working code of javascript creating dynamic form elements. So after generating a couple of textboxes when I click on the "Submit" button it should display all the values entered in the textboxes on the next page.
View Replies
View Related
I am trying to create a page that displays the values the user has just selected from my form. The form consists of three drop down lists. Upon clicking the submit button, I would like to go to a new page that says something along these lines:
"Thank you for filling out the form. You have successfully transfered account _____ (value from one drop down) from ______ (another value) to ________ (the last value)." How would i go about doing something like this?
View Replies
View Related
Does anyone have the code to write all the form values to variables of the same name. So for example request.form("myname") would be stored in a variable called myname after running this. It should just save time from doing the request for all the fields.
View Replies
View Related
Is it possible to save all the names/values of a form to another memo textfield before a Insert to the database then when required on another page split that memo textfield into the name and their corresponding values retrieved from the recordset ?
View Replies
View Related