Trimming Variables Requested From Form
if iam requesting a form field, how do i trim that to just the first 2 letters Code:
View Repliesif iam requesting a form field, how do i trim that to just the first 2 letters Code:
View RepliesI 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:
My record returns a numerical string "02". When I response.write it I want to remove the "0" ONLY from the beginnings. How would I do that?
View Replies View RelatedI have a form with 2 text boxes, when submitted the content is written to a database. Basically it's a page builder, one text box has the name of the page, the other contains the text.I have built a preview page which I want to pass whatever has been typed into the text boxes to, before the form is submitted. Basically what I want to do is pass them as variables to the preview.asp page.
Anybody know how I can do this? The text box names are 'title' and 'text' E
I need to do something very basic. I need to gather information from a form, and when they click "submit", it will take their input and add it to a URL string.
In other words:
Name:
Company:
Click Submit
Goes to http://www.yadayada.com/tom.asp?name=XXXXX;company=XXXXX
How can I do this simple task
It appears that form that I have used for months has stopped passing form variables (via POST) to my asp results page. I have been working through various problems, all caused by the installation of Microsoft XP SP2. I am assuming that this is yet another security issue, but don't know what I should set to overcome this problem.
View Replies View RelatedI know that trim removes white space and the LTrim and R trim removes space from the left or right but how would i trim a string after 20 characters so that i could add ... to the end of the new trimmed string???
View Replies View Relatedif i had a string which looked like this :
,apple, orange, grape, tomatoes
how do i remove the first character[,] from the string using the trim() function?
i don't know what to do here exactly.
i have seen the TRIM function, but i'm not sure if it's the right way to do it.
i have a recordset called RSUSEREDIT.
in the recordset there is a column called "EMail".
i can print out the results using Code:
<%=RSUSEREDIT("Email")%>
the email column always uses the same domain name... - username@domain.com
is it possible to remove the part after and including the "@"?
I'm dynamically building an SQL string to do an execute, and keep ending up with a leftover comma, so the string looks like this.
INSERT INTO Software ( Title, Version, Licensing, Total_Licenses, support_phone, support_email, Campuses_Licensed, Comments, support_web, FundingSource, Course_title, Subject, Grade_level, LocalExpert, ACTIVE, CATE, EntryDate,) VALUES ( 'Bob's Super Crappy Software', '4.3', 'labpack', '36', '555', '555', 'Alexander, Bilhartz, Central, Fairmeadows, Hyman, Daniel', 'James is testing this', 'www.bob.com', 'Campus PO', 'Math', 'Math', '4, 5, 6', 'Patrick Williams', '1', '0',)
Both commas are added dynamically and can be trimmed on the fly. I tried using RTRIM(strSQL, ",") but this didn't work.I put the fields into an array and tried to add only commas to all but the last entry, but that also didn't work.
I have a database field that is a memo type. I would like to be able to only display the first 50 words from the database. I would like for it to show ..... after about 50 words.
I am using <%=Content %>. How do I trim this field to show only 50 words and then ....?
I tried the following code:
Function LengthTrim(input, length)
If Len(input) > length Then
Return Left(input, length) + "..."
Else
Return input
End If
End Function
then <%= LengthTrim(Content, 50) %>
But it would not work. I got the following error message:
Microsoft VBScript runtime error '800a01f4'Variable is undefined: 'Return' .
I am storing URL in a database for a 'sort of' directory type website.The <a href> is built from the recordset of URL's which is all working no problem, easy stuff.What I have found is going to be necessary in some cases is to trim the URL back to just it's www.abc.co.uk address for the link display.
I still want the actual link to go to it's long 'deep linking' location, but there is limited room for displaying a URL that could be a hundred chars long.
Code:
StartTime = FormatDateTime((rs("startdate")),3)
this returns
7/4/2006 1:00:00 AM
I need to trim the seconds off so it looks like this
7/4/2006 1:00 AM
I have a section on my website that lets users to input their own username and password in order to enter the restricted area, but i notice that some of the users likes to use strange characters to use as their username or password.
how could I trim those strange characters ie. like the follow !@#$%^&*()'{}/?~ out of the input field, WITHOUT using the javascript because javascript can be disabled from the browser and by only using the ASP IF ELSEIF statements to do so?
I have an Access db of products which I'd like to use for creating dynamic urls. Each product has a range name which I intend to use to point to the folder containing the relevant image eg pine/001.jpg
My problem is one of the ranges has two names ie Indian Accessories. I can't have a url with a space in it so how can I dynamically alter the field so that it displays the url as either indianaccessories or indian-accessories?
I need to trim a variable to have everything after 4 chars in a string.
IE:
var_temp = 200:16:1234567890
i want everything after 200: to be a variable.
I cannot use:
var_new = right(var_temp,14)
because the string is a different length everytime.
I just dont know this function.
Someone should write a book Javascript for VBScript Programmers. I can't seem to find a native function in Javascript to trim a string. Is there one or does anyone have one handy?
View Replies View RelatedI need help on how to do the following:
1. Submit a form from a.asp to b.asp (arbitrary names)
2. Have b.asp redirect to either c.asp or c2.asp which is decided by a form field gotten from Request.Form("Field")
3. Have all the previous form data available in c.asp
What I need to know how to do is declare the variables from the form on a.asp on b.asp so I can view them on c.asp.
i think this is a simple process but i'm lost on how to format it
page.asp?cnum=Request.form("cnum")something like that?
Could someone please remind me how to get all the form variables in a post?
View Replies View RelatedI have created a form, which has hidden fields, which are to be passed to a payment gateway using the POST method.
My problem is that the variables in the hidden fields do not get passed on to the payment page when the form gets posted. The payment page comes up empty.
Does anyone know why this is happening? Code:
It's regarding an ASP FORM for the credit card process:
I'm collecting credit card information on my secured server. When collecting the Month and Year values (for the expiration date of the card) with Select/Option tags, I don't have a way to concatenate them together prior to submitting the form so I can post them in the format the gateway asked me for (e.g. "mmyy" or "mmyyyy")
Do you have a way where I can submitt those variables togehter in such format? Code:
I have a form that loops through a recordst for the following Code:
View Replies View RelatedI'm interested in knowing how to pass the form variables from page 2 to page 3
Page 1
Gathers info via a form from a person.
Page 2
Uses form variables from page 1 to decide what to do next, it then must pass some of the form variables from page 1 to page 3...
Page 3
Uses different Form variables from page 1 which it has been passed by page 2
I have a form that imputs several variables. Some of these variables are varchar some are smalldate and some are numbers.
What is the recommended method of handeling input that does not fit the required variable type? I am thinking of doing some kind of check and if it is not the required field type just dropping that value (for instance if they type "aaaaa" into a date field I would just turn that variable into "").
I have done a search and came up with many great methods of doing this, but what is the best way? I would like to avoid large Java routines (actually I would like to avoid java all together.
search.asp uses a form to pass two variables ysColu (column name) and ysText (the text being searched for) to result.asp, result.asp then displayes a list based on the two variables.
This all works fine, however whenever the "Next" button is used to page through the recordset the variables reset to their default values. I was wondering is there any way to fix this? Code:
i having problems with calling variables which are sent via a form using the 'post' method. I'm actually using a Flash form to pass the variables. The problem i'm having is reading those variables in the ASP.NET query. I'm using C#. Here is the code i'm using: Code:
View Replies View RelatedFor some reason i keep getting empty values in my form variables, if anyone can spot a reason why then please tell me what I'm doing wrong. Code:
View Replies View Relatedif i have a value of 11.7908787541713
how could i trim it to 11.79 and how do i round the number up?
I am taking a field from a database and attaching it to avariable like so:
varID = rsCheckLogin("LogonID")
This is returning, for example, SA70.
I only need the integer part. How would i remove the SA part, i have belive it must be trim or split but not sure how to use them?
i have a search page results what i want to do is trim the result to 100 chars either side of the matched word but say if the word is at the start or end just to trim 100 chars left or right. does anyone have a function that will do this ?
View Replies View RelatedUsing DW 8 with 3 frames. I want click on whatever in top frame that uses Go To URL which displays results in bottom frame. My problem is that the results in the bottom frame actually runs a recordset (SQL query) that pulls variables from various form elements in the middle frame.
The middle frame never submits the form variables to the server. It only serves as a resource for the getting variables used in the SQL statement. How do I go about addressing variables in the SQL statement ?
I need to flush the form variables after submit. The problem is that the form variables retain their values on page refresh.
I added the following at the top of the asp code,
<%@ LANGUAGE=JAVASCRIPT%>
<%
Response.Expires = -1
Response.ExpiresAbsolute = "Jan 1, 1980 "
Response.AddHeader ("pragma","no-cache")
Response.AddHeader ("cache-control","private")
Response.CacheControl = "No-Store"
%>
But it doesn't seem to work! Any suggestions??