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.
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.
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?
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?
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:
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:
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 ?
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:
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.
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:
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, " ")
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 )
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.
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:
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 ?
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:
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...
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: