Does anyone have anything that checks the input values of a Text Box which ensures that the user has not selects an "ALL" condition? This needs to cover all possibilities, including all possible combinations of wildcard characters which equate to and "ALL" condition. For simplicity, consider a text box with a limitation of 4 characters feeding the variable: &TextInput1. With that in mind, the value of &TextInput1 may be: "ALL", "$", "$$", "$$$", or "$$$$", as well as combined use of other wildcard characters.
Thanks in advance...This message has been edited. Last edited by: Doug,
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
June 15, 2010, 05:27 PM
Dan Satchell
How about something like this:
-SET &ALL_CHECK = IF UPCASE(&TextInput1.LENGTH,&TextInput1,'A.&TextInput1.LENGTH.EVAL') CONTAINS '$' OR '*' OR 'ALL' THEN 'Y' ELSE 'N';This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
June 16, 2010, 12:09 PM
Doug
Close... But, what I'm looking for is to capture all possibilities of all wildcards within the associated field. The only other suggestion was : "I would do it in JavaScript"... But that person doesn't have the JS to do it... JS is acceptable. I can call it as an onClick Event...
June 16, 2010, 12:12 PM
Francis Mariani
If you are so specific about your "wildcards", why can't you come up with the solution?
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 16, 2010, 12:36 PM
Doug
I just don't want to "reinvent the wheel"... That's all... We do have to account for the percent sign, underscore, currency symbol, asterisk, escape sequence, to name a few / most of them. Not to mention that any number of percent signs, for instance, equate to a single percent sign, at least in Teradata SQL. Now, considering that there are many possibilities / combinations of these plus valid alphanumeric characters. With that in mind, I hope you can see why I don't want to reinvent this wheel ~ If, in fact, someone else has already done so.
So, any more suggestions from anyone? If not, I'll invent this wheel for further proliferation in the future.
June 16, 2010, 01:57 PM
Kathy P
Okay, I'm going to bite and ask. Why are you using a text box? Why not a drop down with a drill down, i.e., give them the alphabet, click on a letter, then give another layer of grouping so your list is not so big and keep drilling down until the list is an appropriate size to show in your html. Just a thought. Text boxes are sooooo dangerous. FCSD has a text box search and then you click on search icon for the dealer name.
Kathy Phillips Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03 Windows
June 16, 2010, 04:57 PM
Dan Satchell
Another FOCUS code alternative: use the CHKFMT function.
-SET &RESULT = 0 ;
-SET &CHARCNT = &TextInput1.LENGTH ;
-*
-REPEAT ENDREPEAT1 FOR &I FROM 1 TO &CHARCNT
-SET &CHAR = SUBSTR(&CHARCNT,&TextInput1,&I,&I,1,'A1');
-SET &RESULT = IF &CHAR EQ ' ' THEN &RESULT ELSE (&RESULT + CHKFMT(1,&CHAR,'X','I1'));
-ENDREPEAT1
-*
-SET &FMT_CHECK = IF UPCASE(&CHARCNT,&TextInput1,'A&CHARCNT.EVAL') OMITS 'ALL'
- AND &RESULT EQ 0 THEN 'PASS' ELSE 'FAIL';
WebFOCUS 7.7.05
June 17, 2010, 07:06 AM
Lucas
<html>
<head>
<script>
function checkIt()
{
var x = true;
var testValue = document.form1.textbox1;
if (testValue.value.indexOf("*") >= 0)
{
x = false;
alert("Quit being a character and stop using the '*' character.");
testValue.value = "";
}
return x;
}
</script>
</head>
<body>
<form name="form1" onSubmit="return checkIt();">
<input type="text" name="textbox1" value="*" />
<input type="submit" name="submit" value="Press Me" />
</form>
</body>
</html>
7.6.6 Mainframe 7.6.4 Web Focus Windows
June 18, 2010, 04:49 PM
Doug
Thanks Guys, I'll work towards my goal with both of these...
Lucas: Are you down there near that Big Peach (Water Tower) near the Interstae?
Thanks, Doug
June 21, 2010, 06:50 AM
Lucas
Yes Doug I am, in fact I work just a couple of miles from it. Sad IMO that the only thing this little town is known for is a water tower...
7.6.6 Mainframe 7.6.4 Web Focus Windows
June 21, 2010, 08:18 AM
ABT
quote:
Originally posted by Lucas: Yes Doug I am, in fact I work just a couple of miles from it. Sad IMO that the only thing this little town is known for is a water tower...