Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     JavaScript to divide one variable into two

Read-Only Read-Only Topic
Go
Search
Notify
Tools
JavaScript to divide one variable into two
 Login/Join
 
Gold member
posted
Good Morning:
I have a html page that I'm allowing multiple selections from a drop down list box. The variable I'm passing to the focus program consists of two fields concatenated together. With Javascript I would like to break this variable into two seperate variables. I know I accomplish this within the focus program but I would like to use Javascript. Has anyone done this before ?
 
Posts: 69 | Location: OH | Registered: November 09, 2004Report This Post
Guru
posted Hide Post
Given you have a separator, you can use the method split:

arrayOfStrings = stringToSplit.split(separator);

H�kan
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Gold member
posted Hide Post
I think the problem I'm having is it is not recognizing the value in the select list box. Any thoughts ?
 
Posts: 69 | Location: OH | Registered: November 09, 2004Report This Post
Guru
posted Hide Post
This is what I've used:

var x = document.adj.ACTION.selectedIndex;
var opt = document.adj.ACTION.options[x].value;

Now you can perform your split on the var opt.

H�kan
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Gold member
posted Hide Post
If I use an alert and display the value of 'x' I do see the number representing the item selected. However, if I use an alert to display the value of 'opt' I do not see a value. I should be, correct ?
 
Posts: 69 | Location: OH | Registered: November 09, 2004Report This Post
Master
posted Hide Post
CHERI

FYI besure that the option does have an actual value= in it. Otherwise you will have to use the text.
 
Posts: 865 | Registered: May 24, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     JavaScript to divide one variable into two

Copyright © 1996-2020 Information Builders