TABLE FILE PARTINFO PRINT PART WHERE PART CONTAINS &WHEREIN; ON TABLE PCHOLD FORMAT EXCEL ENDThis message has been edited. Last edited by: paulux99,
November 11, 2013, 11:07 AM
paulux99
I have not found an exact solution where I could use CR or LF in a text area instead of semi colon ; Any suggestions?This message has been edited. Last edited by: paulux99,
November 11, 2013, 03:27 PM
nd
If you can't get the textarea to do multiples. (and you should try adding multiple="multiple" operator="OR" to the textarea tag), then stripping carriage returns and line feeds is more simply done with javascript. By the time they get to the fex, they're already tossed out.
Here's an example that looks for a cr/lf combo following a word (the \b in the search string used by the .replace() method). Making sure it follows a word means that if your users enter blank lines or lines that contain only spaces you won't end up with extra ORs.
This is all handcoded. Again, if you've got HTML composer and all of its hooks in the HTML, try opening the file in a text editor and looking for the textarea tag and telling it that it's a multiple.
Nd, thanks for your suggestion, I am able to display: PART1 OR PART2 R OR PART3=1 OR PART4+1 but I am missing the single quote ' around the record so desired outcome would be to surround with single quote WHERE PARTNO CONTAINS 'PART1' OR 'PART2 R' OR 'PART3=1' OR 'PART4+1'. Assuming the js would need to be updated? or update parts.fex?
November 11, 2013, 05:52 PM
nd
something like
'\'' + \undelimited.replace(/\r\n\b/g, '\' OR \'') + '\''
should do it.This message has been edited. Last edited by: nd,
TABLE FILE CAR
SUM SALES
BY CAR
WHERE CAR EQ &CAR.(OR()).Select cars.;
END
Save it.
Now make a new HTML. Add a form. Link the 'run' button to above fex.
Select "Textarea" as input type.
Check the properties of the textarea.
Multiple should already be set to "Multiple".
Only thing you have to do is set : "Multiple: Add quotes" to "Yes".
Good luck. Dave
_____________________ WF: 8.0.0.9 > going 8.2.0.5
November 12, 2013, 09:36 AM
paulux99
Nd, Thanks for update with single quote, when I update js coding with
document.getElementById(hiddenid).value='\'' + undelimited.replace(/\r\n\b/g, '\' OR \'') + '\'' ;
or this code
document.getElementById(hiddenid).value="'" + undelimited.replace(/\r\n\b/g, '\' OR \'') + "'"
I get the error: "The website declined to show this webpage HTTP 403" Both ie or firefox do not like the extra coding on single quote from js. I tried to lookup for a solution, I did not find anything.
Dave, Thanks for suggestion, I am trying to copy and paste a single column of records with CR in excel (up to 1000 records) to a text area but maybe I can use some part of your suggested code.This message has been edited. Last edited by: paulux99,
November 13, 2013, 10:57 AM
nd
403 is a web server error, and if you're curious, you should look into its logs to see just what it means.
I can offer a tidied, better tested version of the original javasctipt.
function adddelimiter(visibleid,hiddenid){
var undelimited=document.getElementById(visibleid).value;
var orvalue='\'' + ' OR ' + '\'';
var newvalue='\'' + undelimited.replace(/\r\n|\r|\n\b/g, orvalue) + '\'';
document.getElementById(hiddenid).value=newvalue;
}