Using Vbscript "SPLIT" Function On Multi-select Field
I am trying to split a mgrgroup field to extract the MD codes. It correctly grabs the MD codes if all records in a mass update are updated, but if only one record in the loop is updated then it puts the last 5 digits of the mgr name in the MD field.
THIS IS THE CODE: ....
View Replies
ADVERTISEMENT
I am using the following code to split/join values in a multi-select field. It is combining all the values in All the records into one long string in each record in recordset.
Example: I have a recordset with 2 records. The 1st contains the split/joined values: Alan Smir, Jeff Karl The 2nd contains the value: Keith Robb
When it updates database, it will put Alan Smir, Jeff Karl, Keith Robb into each record in the recordset. Instead it should be putting Alan Smir, Jeff Karl into the 1st record
and Keith Robb into the 2nd record in the recordset.
Does anyone see what is wrong with the code ....
View Replies
View Related
I have a multiple select drop down. It will load into it the following information: Student ID, Last Name, First Name
There will be another drop down box that loads with classes, only this is not a multiple select.
I need the user to be able to select all students they need from the first drop down and then select the class they want to insert them into. Then, when they hit the button, it will break up the data from the first, Student ID, Last Name, First Name and insert those three things into the database under those respective column names.
Does anybody know how I can split these up properly when there will be multiple students selected, or does anybody have a better way of doing this?
View Replies
View Related
I have a VBScript function:
<script language="VBScript" type="text/vbscript">
Function Main()
set wshshell = createobject("wscript.shell")
struser = wshShell.ExpandEnvironmentStrings("%USERNAME%")
strdomain = wshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
msgbox struser & strdomain
End Function
</script>
That works great as a Active X script but I want this to display as a value in a text field and I can't find how o do that.
View Replies
View Related
I have a variable which holds college names
strcollege="University of California"
i want a variable to save UoC
what i meant was there are 3 words University of California
so i want the first letter in each word to be stored in a variable ....
View Replies
View Related
Will the Request.form show the correct order that they were displyed in or
will it do something different. I have been testing and it always shows the
order they were displayed.Is this just coincidental?
View Replies
View Related
I have two multi-select boxes...selLeft and selRight. The user moves choices from selLeft to selRight with arrow buttons. selLeft is populated using XML.
My question is, when clearing everything on the screen, how do I repopulate selLeft, without losing items in selRight or repeating items left in selLeft.
I'm a newbie and not familiar with the code used to build the multi select box in the first place. Code:
View Replies
View Related
I am trying to create a form where you may have more than one person
at a meeting, but want to have them be related to the same meeting.
I have a mulitple select text area and if you select more than one,
all the records are being added to the same row. so if I picked the
following three people:
(Person ID/Desc)
1 - mickey mouse
2 - donald duck
3 - goofy
The row in the data base would look like this:
(Meeting ID/ Person ID)
1 - 1,2,3
But I would like to do this:
(Meeting ID/ Person ID)
1 - 1
1 - 2
1 - 3
I hope this makes sense, if it does does anyone have a suggest on how to best do this?
View Replies
View Related
I use a multi-select menu in an ASP so the user can pick several values.
<select multiple name="lbErrorType" size="12">
However, after I have saved the records to the DB, and the user comes back
to edit a prior record, I re-populate the multiple select box and do a
"<option selected>" for each record that is saved to the DB.
<option selected>
But only the last value is selected !?!?
How do I get the select menu to select ALL the appropriate values ?
View Replies
View Related
I know that I can use instr(input,1) etc. but my attempts so far are of little use.
View Replies
View Related
Has anybody ever seen or written code for ASP that would mimic Access'
multi-column combo box? Specifically, I have a drop down box that lists
about 100 five-digit codes. Each of these codes has a long text description
that explains what the code represents.
I'd like to be able to show the code plus description when the drop down
list is dropped down, but just the code when the list is not displayed, so
that I don't have to have a hugely long combo box taking up space. Code:
View Replies
View Related
I want to take a server variable and split it. It would look something like this:
varServerVariable = fistname.lastname
I want it to look something like:
first = firstname
last = lastname
I know that I need to use the Split Function, but I'm not sure of the syntax.
View Replies
View Related
I have a textbox that will have this kind of value.
eg. 1+1, 1+2, 1 +2, 1 + 2.....
So now i need to get the 1 and 2 to add it up. This textbox is for add function.
Before this i using the Mid Function. But this is only work if they entered btwn 1 - 9. If 10 then unable to find it.
I remember there is a function where it will find the value then stop at there. then i only grab the bfore the value. I try to lookup but i can't find the function. I need to get the value bfore + and after + to add it up.
View Replies
View Related
From my system, it allow product has multi-category, so I need to save
all category names which one product belong to into one field on a
database,
and record saved like " nameA|nameB|nameC " - seperate by "|".
question 1:
the second time when i update the record for same product name, how to
have a record
like "nameA|nameB"
After multi-category name saved, then, i would like to generate a
navigate name with the link like
home > nameB > name of product
question2:
so how can i retrieved only one name from category field.
View Replies
View Related
What I am doing is:
If Term = Spring2005 then display everything belongs to Spring2005
If Term = Fall2005 then display everything belongs to Fall2005
And so on.
I used Sub function to do that, but it doesn’t split it? How can we do that?
Code:
View Replies
View Related
User enters a string of words and it's stored in txtHAR.
I then do this,
txtArray = split(txtHAR," ")
After this step i'm lost. Because user can enter as many words as they want how am i to track the number of words txtHAR has split into?
View Replies
View Related
this code gives me one short of the ubound function, what is wrong?
e.g if i have 353425432,325423,2542354
it gives me 2 instead of 3
jumvar = request.QueryString("one")
jumvarsplt = split(jumvar,",")
valnum = CInt(ubound(jumvarsplt))
View Replies
View Related
I am trying to loop around a split and the code I have is below:
response.Write("<tr>")
response.Write("<td class=""tableHeader"" valign=""top"">Keywords</td>")
keywordsSplits = Split (keywords, ", ")
For each keywordsSplit in keywordsSplits
response.Write("<td>")
response.Write(keywordsSplit)
response.Write("</td>")
Next
response.Write("</tr>")
The problem is that it does actually put the seperate keywords into seperate cells (td's)
I get the following:
<tr>
<td class="tableHeader" valign="top">Keywords</td>
<td>test test1 test2 test3</td>
</tr>
I actually want
<tr>
<td class="tableHeader" valign="top">Keywords</td>
<td>test</td>
<td>test 1</td>
<td>test 2</td>
<td>test 3</td>
</tr>
Can anyone help?
View Replies
View Related
i want to use split function in sql line ....
View Replies
View Related
I'm using the split function to split forename and surname, but sometimes there is no second name, is there any way of doing a check to see if there is a second part in the array?
this is the split:-
WordArray = Split(strUsername, " ")
View Replies
View Related
How do I highlight a split function text?
code ....
View Replies
View Related
Basically I am using XMLHTTP to pull a file ( template ) then I am using replace to replace tags i.e. [code] with a HTML equiv.
So now I need to know how I can split [Menu|http://localhost/root3/cgi-bin/templates/menu.asp?Top] so that I can use XMLHTTP to pull that file and output it as HTML.
I know how to split a string, but I can't call this [Menu|http://localhost/root3/cgi-bin/templates/menu.asp?Top] as a variable as it can change at any time.
p.s I mean how Sitepoint does the url replacement, it will have a replace function that will first search for URL and then convert what ever is after the = into a url, then what ever is after that as the name.
[-URL=http://]test[/-URL] ( I put -'s in to stop the replacement )
View Replies
View Related
I am having trouble loading the result of a VBscript split function into an array. The script is supposed to take the user's login name (the form for this is name separated by underscores such as john_foo or lisa_wilson), split it at the underscores, and load first, middle and last name into an array. The problem I keep getting though, is that I am getting a type mismatch error. Here is the code:
<%dim LogName, NameArray(), FirstName, LastName, MiddleName, LastPage
'Get NT authorized login info
LogName = request.servervariables("logon_user")
NameArray = Split(LogName, "_")
for x = 0 to UBound(NameArray)
response.write NameArray(x) & "<br>"
next
%>
The FirstName, MiddleName, LastName vars are supposed to take the array values later.
View Replies
View Related
Is it possible to retrieve data with ASP sorted on 2 fields? I've tried :
SELECT * FROM [TableName] ORDER By Field1 AND Field 2
But it gives an error. I've searched the internet on this topic to no avail.
Is it possible?
View Replies
View Related
I'm probably doing something wrong here but when I try to get onlyl the records which occur after today's date, I get all of the records from the table, before and after today's date. Code:
View Replies
View Related
I need the VBScript equivalent of the Math.ceil(x) function?
View Replies
View Related
Ok I know there are lots of posts out there for this problem but no matter what I try I can not seem to get it to work
What is wrong with this syntax
sSQL = "SELECT * FROM serviceHostingMatrix WHERE start_date = "# & startDate & #";"
startDate is a variable that I filled from another tables date field
getting this error
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
View Replies
View Related
Is there a possibilty to use the function <SELECT NAME="user"><OPTION>user 1</OPTION></SELECT>
from a database. I want to get the data out from a table and store the data from that column in a dropdown box. What's the way to do this ?
View Replies
View Related
I've got a database that has 5 numeric values for each record. I'm trying to figure out how to have the records sorted alphabetically, but highlight the highest value in the table for each column. So in other words, the table shows up with one record in each row, with a total of 6 columns (the name plus 5 columns). I want the highest value in each column to be emphasized.
So the final product would end up looking like the code at the bottom of this message.
I've pulled the records from the Access database and am able to sort them alphabetically and get the table to appear. What I was thinking is that at the top I'd define variables that correspond to the highest record for each column. Then in the table code I'd set the colour of each cell using an 'if then'.
So I have 3 specific questions:
- Is that the best way to do it? I don't want the page to take 20 minutes to load because I'm overloading the server.
- how would you set the variables at the top of the page?
- how would you write the if then in the middle of the table to change the background colour of the cell if that value (or values, in case there's a tie) is the highest of all the records? Code:
View Replies
View Related
I am struggling to call a vbscript fn from my form (in asp page)
My code looks like below:
<input name="b1" type="button" value="Update Status" onClick="test()"/>
<%
Function test()
msgbox "hello! how are U?"
End Function
%>
Any tips on how I can make this work?
View Replies
View Related
What is the syntax for calling a VBScript function from a hyperlink ?
View Replies
View Related
Say I have a field containig some text, for example: The quick brown fox jumped over the fence. How do I only show the first 4 words of the sentance, i.e: The quick brown fox...
View Replies
View Related
I have an ASP admin script where I'm adding records, and I have a
category that already has set name values hard-coded into a selct option
pulldown, but if the user wants to create a new category and not use the
select pulldown, the value will end up being " , newvalue" when posting
from this sequence of pulldown and input text box:
<select name="CategoryName">
<option selected></option>
<option value="first">first category</option>
<option value="second">second category</option>
</select>
<br>
New Category<br>
<input name="CategoryName" type="text" size="26"
maxlength="255">
What is the best way of not having that extra preceeding comma appear as
the value if the user chooses to add a brand new category?
View Replies
View Related