I got a system where a user chooses his/her course and then goes to a checkout page where the course items are in the shopping cart on the page.
Now the user needs certain criteria to be registered for the course like studentName, studentID, courseName & courseType.
anyways now when the user has entered all his information after picking his course, it first goes to a page where i load the specific criteria needed to register into session state and then it does a automatic redirect to the bank, i do this becuase no information returns when it has been processed by the bank, so if the transaction is successful it goes back to the session state page where the information is waiting there in hidden labels. ready to get posted to the student registration.
the format of the course name is Access+2003+Series, now once its come back from the bank and all the format i retrieve from session state is Access_2003_Series, now when it posts the student is not registered because it has to be posted with either the + sign or a blank space.
IS there some way on the page that i can remove the _ and change it with the + sign ????
i think it has something to do with REGULAR EXPRESSIONs.
4 1065
can it be handled by your client-side application? i'm assuming you're talking a web-based application here and you received the data as string. can you create a client-side function/proc to replace the string you need (ie VBSCRIPT, JAVASCRIPT, etc)? if you can not and you have to pass this entire string into a stored proc and you need this string manipulation in T-SQL, there's a replace function in sql 2005, don't have time yet to test if it's in sql2K, sorry ;)
http://msdn2.microsoft.com/en-us/library/ms186862.aspx
-- CK
can it be handled by your client-side application? i'm assuming you're talking a web-based application here and you received the data as string. can you create a client-side function/proc to replace the string you need (ie VBSCRIPT, JAVASCRIPT, etc)? if you can not and you have to pass this entire string into a stored proc and you need this string manipulation in T-SQL, there's a replace function in sql 2005, don't have time yet to test if it's in sql2K, sorry ;)
http://msdn2.microsoft.com/en-us/library/ms186862.aspx
-- CK
It is web based.
the info gets posted to that page where eventually i land on after the transaction has been successful....there i call it from session state and place it into a label on screen.
i need someway to change the _ to a + sign in order to post that data for the next step.
i tried to write a <script> so that it wld search for the _ on page load and change it too a +. - <script type="text/javascript" language="javascript">
-
function Replace(str)
-
{
-
return str.replace(/\_/g, "+");
-
}
-
</script>
but that doesnt work.
if you're going to handle this in front-end, it's becoming a scripting problem, not sql-server.
do you need the _ be repalce to + before it goes to db? coz if inside the db and before you store in in the table you can use the replace function
-- CK
if you're going to handle this in front-end, it's becoming a scripting problem, not sql-server.
do you need the _ be repalce to + before it goes to db? coz if inside the db and before you store in in the table you can use the replace function
-- CK
i worked it out hehe,
the problem was on the checkout page....the querystring was already being changed from + to _ so i revered that ... - function QueryString(param){
-
var loca = document.location.href;
-
if(loca.indexOf('?' param '=')>-1 || loca.indexOf('&' param '=')>-1){
-
var qString = loca.split('?');
-
var keyVal = qString[1].split('&');
-
for(var i=0;i<keyVal.length;i ){
-
if(keyVal[i].indexOf(param '=')==0){
-
var val = keyVal[i].split('=');
-
return val[1];
-
}
-
}
-
return false;
-
}else{
-
return false;
-
}
-
}
-
-
function Trim(str){
-
return str.replace(/[\(\)\.\-\s,]/g, "");
-
}
-
function Trim2(str){
-
return str.replace(/[\(\)\R\-\s,]/g, "");
-
}
-
-
function Replace(str){
-
return str.replace(/\_/g, "+");
-
}
-
function Replace2(str){
-
return str.replace(/\%26/g, "and");
-
}
-
-
function moneyFormat(input) {
-
var dollars = Math.floor(input);
-
var tmp = new String(input);
-
-
for ( var decimalAt = 0; decimalAt < tmp.length; decimalAt ) {
-
if ( tmp.charAt(decimalAt)=="." )
-
break;
-
}
-
-
var cents = "" Math.round(input * 100);
-
cents = cents.substring(cents.length-2, cents.length)
-
dollars = ((tmp.charAt(decimalAt 2)=="9")&&(cents==""))? 1 : 0;
-
-
if ( cents == "0" )
-
cents = "00";
-
-
return(dollars "." cents);
-
}
-
-
-
</script>
Sign in to post your reply or Sign up for a free account.
Similar topics
by: J.C. Flores |
last post by:
Hello all,
First of all, I must state that I'm new to SQL Server, but have been a
long-time software guy for quite some time. Please excuse the potential
simplicity of the solution to my...
|
by: Spike |
last post by:
Hello!
Im going to make a javascript for changing alot of images. But im not
sure how to do it., where to start..
Ok, first.. this is the isue.
I have 3 images(I call them 1a-3a).
when u...
|
by: beanweed |
last post by:
BACKGROUND
----------
I have an ASP.NET application having two panels. In one panel, an XML
document, transformed using xsl, is displayed. In the other panel are some
controls that allow a user...
|
by: Hank |
last post by:
My Access 2000 code has been running for several years in our main
plant. Now we need to install it, as a stand-along application, at
remote sites, some of which are out of state.
My problem is...
|
by: Fabrizio |
last post by:
(Sorry for the crosspost, but I really don't know which is the right
newsgroup!)
Hi all,
I try to change the password to a user that as to change the password at
first logon:
try
{
|
by: active |
last post by:
It appears to me that if I change the Control's client size the controls
size does not change to agree with the new size.
Does it work like the VB6 ScaleWidth and ScaleHeight?
That is after I...
|
by: Tom |
last post by:
I am writing a Visual basic .Net database application.
There are many forms that first let you select and look at
a DB record and then when you click a "modify" button you
are allowed to change...
|
by: J |
last post by:
Hello. I apologize if this isn't the appropriate group for this question
but I was wondering if it's possible to allow regular windows domain users
to change their passwords through an .asp page? ...
|
by: Simon |
last post by:
Dear reader,
The syntax for the VBA code to change the RowSource of a Master Report is:
Me.RowSource = "TableOrQueryName"
|
by: monkey1001 |
last post by:
my program is suppose to show my due change and i got it working but my change and coins are wrong how can i improve it thank you..(its supposed to be in java)
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |