text field, but want to display $9999.99 format
I use the text field and want to put a size on this field to display the format $9999.99.I put FML999G999G999G999G990 in the format mask, but it does not work.
Can someone show me how?
Thank you.
Hello:
The format mask applies only if the source of the text element is set to be "Column of the database"
You can use a 'Post calculation calculation' instead. Use an expression such as
to_char(:PAGE_ITEM,'FML999G999G999G999G990')
CITY
Tags: Database
Similar Questions
-
expnds of expandable text field, but does not go to the second page, why?
Hello
After working hours and read blogs, I was able to create a form with several fields stretch.
the problem is that they aren't going to the second page. they will be cut off and sometimes everything is moving to a second page and I have a blank page first.
Help, please.
I need to talk to happen when I use tables in my forms. simple text will be more flow to the next page very well.
The problem when there are tables
Send the form and a description of the problem to [email protected] and I'll have a look when I get the chance.
Paul
-
text field variable display in AS3?
Hi, in a simple AS2 .fla there is a "message_number" labeled text field that will display the variable "numero_de_message". Very simple.
How to make a text field in AS3 to display this variable?
Thank you
Yes, AS2 makes it a little easier to use textfields as variables, but they could painful as well.
You have not a variable share the textfield instance name in your code, and you should not. This would cause a conflict of namespace. You can create a separate variable of the textfield that you use to manipulate the value of, but may not have the same name.
Work of TextFields with chains, non-numeric values, so when you read or assign values, you may need to convert numbers or strings as appropriate. I have marked your code such that it should work well using the textfield object only.
In addition, assuming that you are not trying to create separate class files, you need not import everything you have lined up at the beginning. Flash will be automatically takes in charge of the acquisition of those in particular, although there are others that you do not want to import.
message_displayed. Text = "0";
message_requested. Text = "0";
MovieClip (root),.stage_target_mc.internal_stage_target_mc.load (new URLRequest ("message_" + message_displayed.text + ".swf"));
next_btn.addEventListener (MouseEvent.MOUSE_DOWN, next_message);
function next_message(event:MouseEvent):void {}
message_displayed. Text = String (number (message_displayed.text) + 1);
MovieClip (root),.stage_target_mc.internal_stage_target_mc.load (new URLRequest ("message_" + message_displayed.text + ".swf"));
}
back_btn.addEventListener (MouseEvent.MOUSE_DOWN, back_message);
function back_message(event:MouseEvent):void {}
message_displayed. Text = String (number (message_displayed.text)-1);
MovieClip (root),.stage_target_mc.internal_stage_target_mc.load (new URLRequest ("message_" + message_displayed.text + ".swf"));
}
request_btn.addEventListener (MouseEvent.MOUSE_DOWN, request_message);
function request_message(event:MouseEvent):void {}
message_displayed. Text = message_requested.text;
MovieClip (root),.stage_target_mc.internal_stage_target_mc.load (new URLRequest ("message_" + message_displayed.text + ".swf"));
}MovieClip (root) .stop ();
-
How can I validate numeric values in a text field?
Hello
Once more, I have a problem.
I have a field in which the user must enter 10 digits in the model 999999-9999. The field should contain only numbers and must be exactly 10 characters. I have a validation script on the button "print", which prevent printing if required fields are empty or not properly filled out.
I tried two ways of working this point, and I'm not satisfied with any of them, I can always print despite warning messages and validation scripts.
1.
I put the type numeric field, limited to 11 characters.
Display model num {999999-9999}, change the model num {999999-9999} and validation model num {999999-9999}
Problems using this solution: when I type 11 digits in the field (ex.12345612345) I get a warning message and 12.345.612
But when I type 9 digts (e.g. 123456-123 or 123456123) I get no message warning and 000000-0000 or 012345-6123
If I type alphabetic characters (e.g. 123456 abcd) I get no warning message and 000000-0000.
2.
I put the field in the text field, limited to 11 characters.
The model text {999999-9999}, edit text model {999999-9999} and {999999-9999} model validation
Now, when I type 11 digits in the field (ex.12345612345) I don't get any warning messages and 12345612345
When I type 9 digts (e.g. 123456-123) I get no warning message and 123456-123
When I type 9 digts (e.g. 123456123) I get a warning message and 123456123
If I type alphabetic characters (e.g. 123456 abcd) I get a warning message and 123456 abcd.
It works a little better as a text field, but I'm not satisfied at all.
Someone at - there a solution to this?
Additional I also want the hyphen to emerge automatically when you type.
K
Regular expressions are useful for this type of validation. The code below tf1 is a text field with a maximum length of 12.
Form1.Page1.TF1::exit - (JavaScript, client)
If (!) ((this.isNull))) {}
var FO = this.rawValue;
\d to match any character in the range 0-9
regExp var = \d{6}\-\d{5}/;
If (!) () {regExp.test (tf)))}
xfa.host.messageBox ("the field must be in the format of 123456-12345.", "Validation", 1);
}
}
{The \d{6}\-\d{5}/ expression tests 6 digits \d{6}, a dash-- and 5-digit \d{5}.
Steve
-
I create a dashboard with lots of buttons that display pieces of text to an XML file. The problem is, I can't understand how to clear the text field, once it is posted. If I press another button, the new data will replace the old data, but if the new button is display a smaller set of data, it won't replace some of the old data set and the rest remains displayed. Who is?
I found a code that removes the text fields, but I don't know where to put:
///////////////
import flash.events.MouseEvent;
import flash.text.TextField;
var adminUnitsXML:XML;
var adminloader:URLLoader = new URLLoader();
adminloader.addEventListener (Event.COMPLETE, onAdminComplete);
adminloader. Load (new URLRequest ("FY2012units.xml"));
function onAdminComplete(evt:Event)
{
adminUnitsXML = new XML (adminloader.data)
}
var adminMeasuresXML:XML;
var adminloadermeasures:URLLoader = new URLLoader();
adminloadermeasures.addEventListener (Event.COMPLETE, onAdminCompleteMeasures);
adminloadermeasures. Load (new URLRequest ("2011xmlmeasures.xml"));
function onAdminCompleteMeasures(evt:Event)
{
adminMeasuresXML = new XML (adminloadermeasures.data)
}
-Buttons on unit-------.
adminu1.addEventListener (MouseEvent.CLICK, adminu1Click);
adminu2.addEventListener (MouseEvent.CLICK, adminu2Click);
adminu3.addEventListener (MouseEvent.CLICK, adminu3Click);
adminu4.addEventListener (MouseEvent.CLICK, adminu4Click);
adminu5.addEventListener (MouseEvent.CLICK, adminu5Click);
adminu6.addEventListener (MouseEvent.CLICK, adminu6Click);
adminu7.addEventListener (MouseEvent.CLICK, adminu7Click);
adminu8.addEventListener (MouseEvent.CLICK, adminu8Click);
adminu9.addEventListener (MouseEvent.CLICK, adminu9Click);
adminu10.addEventListener (MouseEvent.CLICK, adminu10Click);
adminu11.addEventListener (MouseEvent.CLICK, adminu11Click);
adminu12.addEventListener (MouseEvent.CLICK, adminu12Click);
adminu13.addEventListener (MouseEvent.CLICK, adminu13Click);
adminu14.addEventListener (MouseEvent.CLICK, adminu14Click);
adminu15.addEventListener (MouseEvent.CLICK, adminu15Click);
adminu16.addEventListener (MouseEvent.CLICK, adminu16Click);
adminu17.addEventListener (MouseEvent.CLICK, adminu17Click);
Here I attributed to plaintext to all buttons;
adminu1.addEventListener (MouseEvent.CLICK, plain text);
adminu2.addEventListener (MouseEvent.CLICK, plain text);
adminu3.addEventListener (MouseEvent.CLICK, plain text);
adminu4.addEventListener (MouseEvent.CLICK, plain text);
adminu5.addEventListener (MouseEvent.CLICK, plain text);
adminu6.addEventListener (MouseEvent.CLICK, plain text);
adminu7.addEventListener (MouseEvent.CLICK, plain text);
adminu8.addEventListener (MouseEvent.CLICK, plain text);
adminu9.addEventListener (MouseEvent.CLICK, plain text);
adminu10.addEventListener (MouseEvent.CLICK, plain text);
adminu11.addEventListener (MouseEvent.CLICK, plain text);
adminu12.addEventListener (MouseEvent.CLICK, plain text);
adminu13.addEventListener (MouseEvent.CLICK, plain text);
adminu14.addEventListener (MouseEvent.CLICK, plain text);
adminu15.addEventListener (MouseEvent.CLICK, plain text);
adminu16.addEventListener (MouseEvent.CLICK, plain text);
adminu17.addEventListener (MouseEvent.CLICK, plain text);
-Button of the device functions-------.
Here's the function of clear text, but I don't know where to put this. When it is placed here, I can't get my text to display when I click on the buttons.
function clearText(e:MouseEvent):void {}
measures_txt. Text = "";
measures1_txt. Text = "";
measures2_txt. Text = "";
measures3_txt. Text = "";
measures4_txt. Text = "";
measures5_txt. Text = "";
measures6_txt. Text = "";
measures7_txt. Text = "";
measures8_txt. Text = "";
measures9_txt. Text = "";
measures10_txt. Text = "";
}
function adminu1Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu1.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu1.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu1.employeect.text ())
measures_txt. Text = (adminMeasuresXML.measure [6].rdu.text ())
measures1_txt. Text = (adminMeasuresXML.measure [6].mmrslt.text ())
measures2_txt. Text = (adminMeasuresXML.measure [7].mmrslt.text ())
measures3_txt. Text = (adminMeasuresXML.measure [10].mmrslt.text ())
measures4_txt. Text = (adminMeasuresXML.measure [11].mmrslt.text ())
measures5_txt. Text = (adminMeasuresXML.measure [12].mmrslt.text ())
measures6_txt. Text = (adminMeasuresXML.measure [13].mmrslt.text ())
measures7_txt. Text = (adminMeasuresXML.measure [20].mmrslt.text ())
measures8_txt. Text = (adminMeasuresXML.measure [24].mmrslt.text ())
measures9_txt. Text = (adminMeasuresXML.measure [25].mmrslt.text ())
measures10_txt. Text = (adminMeasuresXML.measure [26].mmrslt.text ())
}
function adminu2Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu2.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu2.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu2.employeect.text ())
measures_txt. Text = (adminMeasuresXML.measure [6].rdu.text ())
measures1_txt. Text = (adminMeasuresXML.measure [14].mmrslt.text ())
}
function adminu3Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu3.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu3.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu3.employeect.text ())
}
function adminu4Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu4.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu4.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu4.employeect.text ())
}
function adminu5Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu5.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu5.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu5.employeect.text ())
}
function adminu6Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu6.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu6.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu6.employeect.text ())
measures_txt. Text = (adminMeasuresXML.measure [1].mmrslt.text ())
measures1_txt. Text = (adminMeasuresXML.measure [8].mmrslt.text ())
measures2_txt. Text = (adminMeasuresXML.measure [9].mmrslt.text ())
measures3_txt. Text = (adminMeasuresXML.measure [27].mmrslt.text ())
}
function adminu7Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu7.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu7.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu7.employeect.text ())
}
function adminu8Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu8.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu8.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu8.employeect.text ())
}
function adminu9Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu9.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu9.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu9.employeect.text ())
}
function adminu10Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu10.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu10.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu10.employeect.text ())
}
function adminu11Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu11.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu11.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu11.employeect.text ())
measures_txt. Text = (adminMeasuresXML.measure [2].mmrslt.text ())
measures1_txt. Text = (adminMeasuresXML.measure [3].mmrslt.text ())
}
function adminu12Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu12.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu12.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu12.employeect.text ())
}
function adminu13Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu13.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu13.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu13.employeect.text ())
}
function adminu14Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu14.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu14.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu14.employeect.text ())
measures_txt. Text = (adminMeasuresXML.measure [4].mmrslt.text ())
measures1_txt. Text = (adminMeasuresXML.measure [5].mmrslt.text ())
}
function adminu15Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu15.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu15.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu15.employeect.text ())
}
function adminu16Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu16.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu16.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu16.employeect.text ())
}
function adminu17Click(event:_MouseEvent):void {}
UnitBudget_txt.text = (adminUnitsXML.adminu17.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu17.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu17.employeect.text ())
}
IN EAC h case when you assign text, if you want the textfields which have no new text to display nothing, then you must assign them nothing in the form of text. What you could do for each case, it's the same unique feature allows to clear all fields before rewrite you everything, as in...
function clearAll (): void {}
UnitBudget_txt.text = UnitName_txt.text = UnitEmployees_txt.text = measures_txt.text = measures1_txt.text = "";
}
function adminu15Click(event:_MouseEvent):void {}
clearAll();
UnitBudget_txt.text = (adminUnitsXML.adminu15.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu15.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu15.employeect.text ())
}
function adminu16Click(event:_MouseEvent):void {}
clearAll();
UnitBudget_txt.text = (adminUnitsXML.adminu16.budget.text ())
UnitName_txt.text = (adminUnitsXML.adminu16.uname.text ())
UnitEmployees_txt.text = (adminUnitsXML.adminu16.employeect.text ())
}
and so on for all the others...
-
set the focus to the text fields named incrementally
I created the many (hundreds) of the fields of text through actionscript. I gradually name them and place them on the stage and then subsequently access to set focus.
I use create a textfield object:
var txtbox:TextField = new TextField();
and then use a name incremented to the text field to identify it later:
var txtname:String = txtn + txtcnt; txtcnt is a number incremented variable. txtn is a string variable.
txtBox. Name = txtname;
I add an eventlistener on stage. The event listener works very well and has a companion function.
I can identify the text field I want access once the move is running through his name.
Then I use this .name property to set the focus:
internship. Focus = "txt88";
Again, "txt88" is the .name of the text field.
What I am doing wrong?
ypeError: Error #1034: Type coercion failed: cannot convert "txt88" in flash.display.InteractiveObject.
to MethodInfo-(200)
Also, I tried to use the variable incremented during this step, but get a msg of error affecting the variable this way textfield name.
var txtname:TextField = new TextField();
Awesome!
Who did it! I appreciate your help. It is a major obstacle and I went through the help files and books without success. (If it works fine in the AS2 version!)
Anyway, you are a lifesaver. Thank you. -
link to the function in the dynamic text field
so I have a dynamic text field that needs to display something like...
You have been identified as Syd Barrett. If it is incorrect, click here
the dynamic part is the name of Syd Barrett in this example, which is introduced by a variable. now how the word 'here' to become a link to an ActionScript function and a different color?
I was wondering how to do this also. There is a global function called asfunction, described in language AS as Reference: a special protocol for URLS in HTML text fields that allows an HREF link call an ActionScript function.
The code below is what you're after. Your use does not need the setting but I included it for info. The parameter must be a single string, so if you want to pass multiple values, you need to analyze the in your function. -
Disable auto-capitalisation in text field
I do a text field, but I don't want the first letter capitalized. None of the types of entry is not really what I want.
It was suggested in another thread that define addresses worked and do not add a symbol or .com to the keyboard (http://supportforums.blackberry.com/t5/Cascades-Development/TextField/m-p/1831441/highlight/true#M15...).
Does anyone with a camera can confirm that it is always true? Or is there any other suggestions to make what I want to do?
Never head, I found my answer: http://developer.blackberry.com/cascades/reference/bb__cascades__textinputflag.html#type
-
I have a PDF file created from Microstation.
I try to add some text fields, but it crashes whenever I have add a text field.
Literally, it takes more than a minute per text field.
The file size is only 475 KB so its not too big.
I use Acrobat Professional X
I already tried flattening of the document and NOTHING!
I have re-print the file using PDFCreator and NOTHING!
Please help me :-(
Kind regards
I'm sorry, I thought you were using 11 Acrobat. Preferably this parameter was introduced with Acrobat 11. In Acrobat 10, you can instead set the agenda tab 'Order tabs by Row' or something other than manually or not specified. To do this in the "Tab order" drop-down list in the component fields in form editing mode. If you want a custom tab order, wait until set when you have added all the fields.
-
Masking printed lines in a multiline text field?
I am designing a form using Adobe Acrobat XI. This form is designed to be multi use. It can be printed and completed by hand or it can be filled electronically.
When the user chooses to complete the form electronically, entering into a multiline text field, I want to hide the printed lines. After leaving the field, I want the lines will still be hidden if any text has been entered in the field. I know that this can be accomplished by using a script in the Action of the box text field properties window, but I can't find the correct script and triggers. Any help is very appreciated.
Here is the solution:
In the onFocus event, you add this line of code:
event.target.fillColor = color.white;
and in the onBlur event, you add this line of code:
If (event.value.toString () .length< 1)="">
event.target.fillColor = color.transparent;
}
The script of the onBlur event is required to set back field transparent background when you tab through an empty field; When you tab through a field, the Format event will not occur.
-
Dynamic Actions disable button based on the text field
Hello
Sorry if this has already been asked but I checked and could not find a job.
«I'm trying to disable / enable a button "view" among the elements of this region from if a text field has a value or.» I created a dynamic action for this but its not working only partially. I can get the button to be disabled or enabled when I leave the text field, but what I'm trying to do is to get the State of button to change as soon as I start to type in the text field or return to people with disabilities if the text is deleted.
I don't know that I'm missing something simple and help you can give is greatly appreciated.
I use APEX 4.1 and that's how I got the dynamic action implementation, I tried different but no event types to give them action I want.
I also install an example (details below)
Event - change
Selection type - point
Article (s) - P1_TEXT
Condition - is null
Real Action
Action - disable
Fires when the result of the event is - real
Fire on the loading of the Page - Y
Items affected - button
Article (s) - P1_BUTTON
Action of false
Action - Enable
Fires when the result of the event is - fake
Fire on the loading of the Page - Y
Items affected - button
Article (s) - P1_BUTTON
workspace - show_issue
user_name - show_issue
password - show_issue
app_id - 61707
http://Apex.Oracle.com/pls/Apex/f?p=61707:1
It works as expected if you change the event of 'Change' for 'key version?
-
Connection of a drop-down text field and box
I am new to livecycle and have only used it for 2 days. I be so grateful for all the amazing expert help I found here. I think that my first form is almost over. I'm having a problem with one last question. I created a database with two fields. field 1 is name and displays a name I.E. John Doe, zone 2 is ID and contains a single string as 12345678. I created a drop down list for name and it works fine, I see all the names in the database. I then created a text field I want to show ID in.
Example when
Name ID
John Doe 12345678
And if another use is selected
Name ID
DOE 12345987
How can I connect these two fields to display the correct data?
Hello
When you have linked the drop-down list for the data connection you set the value of the element and the text of the item properties in this dialog box
If you have set the value of the element to ClientID, which would get the customer name and customer id in the drop-down control on the form, then this.boundItem (xfa.event.change) when xfa.event.change contains a text value of the element will return the value of the element (or the id of the customer in your case)
Concerning
Bruce
.
-
How to enter the numbers &; text text field?
I design a form for our case Labor, and in the case # field, which I put in place as a (text field), I wish for the user to enter the following as an example:2014-DAA-000012
I would like for the hyphens automatically display as does the social security number. Notice to fans on that? Thank you!
Hello
You can use templates to format you enter a little.
You need 2 models in your text field:
One for display...
text {9999-AAA-999999}
... and the other for editing.
text {9999AAA999999}
-
Print everything that is typed in the text field without printing the text fields
Hello
I am trying to print a form once filled the text fields I want to print just what I typed in the field, not the text field and the color in the text field. I use CS3.
Any help would be appreciated!
Hello Teddy and wellcome to the Group!
If you want to change the fonts or other things, then you will need to use the PrePrint method. What I usually do is select PrePrint in the 'Show' section in the Script Editor (if you did not go to the toolbar at the top, Windows and select Script Editor). After selecting PrePrint you can now either type the name of the subform and the field you want to change (or you can place the cursor in the script dialog box, hold down the CTRL key and select the field with the mouse) and enter in the JS to change font. It's something like TextField1.fillcolor = "255, 255, 255; (which changes the background in white fill). You can also replace fillcolor fonts or border to change the color of the police or the border. I put a link to an Adobe website that goes over the color JS below changes. You just need to add a method of pre-press for each field that you want to remove the necessary on highlighting. Then once the user hits a button print that you have on the form or use CTRL + P to print the form, it will remove any highlighting.
Now on the text field does not itself feel that I do not know what you ask for. You ask for the legend does not print or not there is a box around the data entered. If you don't want to have a box surround the text field located in the section purpose of the field (see image below). You just need to select none, if you want to just text. If you want to change that with JS, I put another link below that has the code to change the color of the border in white and the user can't see it. If you do not want to print the legend, the only method is to remove the legend from the text box and replace it with a static text that can be hidden, but I guess that it isn't what you're talking about (correct me if I'm wrong however).
-
is there a way to get the index of the html text field cursor position
I'm working on a block of text as MC with 'insert text at position X' and 'Find and replace' can someone tell me how to find the index of an html text field cursor. Selection.getBeginIndex (), Selection.getEndIndex (), Selection.getCaretIndex () as far as I know these methods only work with text and not htmltext.
What I'm trying to do, it's affecting different parts of the chain to the variables so that I can combine in order to restore my html string.ray1872:
If I understand correctly, you want the corresponding position in the
another index of the caret htmlText property (who, like you, has no on the)
position in the plain text of the textfield content version).Here's how I'd do. It is perhaps easier or more effective
way (using objects XML etc.), but I don't know it. You could conduct all
your search string in plain text and then convert the result of
the positions of html. I didn't build this to accept negative parameters
for the parameter pos (for example, end of string towards the back), but the
function could be adapted to do this also if necessary. The test data is
not good html from a text field, but it does not really matter what he
is as long as its formatting correctly. It separates only tags of
content to allow apples to apples comparison.some test data
var testStringXML = ""Hello I can't tell you hOE happy I mod. '; "
var undecoratedString = Hello "I can't tell you how happy I am.";the conversion function
function findDecoratedPosition(pos:Number,_xmlString:String,_test:Boolean):Number {}
anything between '<' and="" '="">' should be excluded from the search in plain text.
create a table of elements of array (n = 2), consisting of tag and then plain text
requires xml/html properly put in the form
var tempArr:Array = xmlString.split (')<>
for (var aa = 0; aa
tempArr [aa] is [aa] tempArr,.split(">").;
}
remove the first and last elements in the new array (they are empty)
tempArr.pop ();
tempArr.shift ();
find the location of corresponding plaintext and calculate the position "decorated."
var retPos:Number = 0;
var posCount:Number = 0;
for (var aa = 0; aa
retPos += tempArr [aa] [0] .length + 2 + tempArr [aa] [1] .length;
+ 2 allows you to lack< and="">
posCount += tempArr [aa] [1] .length;
If (posCount > pos) {}
return (retPos + (pos-posCount));
}
}
out of range
Returns - 1;}
test code:
for (var aa = 0; aa
var altPos = findDecoratedPosition (aa, testStringXML);
trace (undecoratedString.charAt (AA) +"position" + aa + "in clear corresponds to the position" + altPos + "in decorated version [" + testStringXML.charAt (altPos) + "" "]" ");}
'>
Maybe you are looking for
-
The 'Display Zoom' feature is supported for ipads? On an IPhone, you will access this setting via settings-> display and brightness-> display Zoom. Thank you.
-
ThinkPad with transflexive, outdoor screens
Hello I want to replace my R51 with something a bit faster and lighter (T400, T61, X...).One of the most important features for me on the R51 is transflexive screen.The screen is readable in full sun with minimal background light. What current Thinkp
-
Lost my old conversations of Messages
I had a conversation of Messages indicating permanently there are unread messages when there was not. I tried to fix it by deleting files ~/Library several. It worked. He removed the history of all my conversations. I thought that once I've reconfigu
-
My laptop will not stop "updated" & restart. What's weird, is that he is not yet updated anything (0% - 3/3) and will go directly to restarting on & more? What should I do? (I have windows vista)
-
Definition of custom paper size Deskjet 3520
Hello. I need to define my own custom for printing paper size Christmas cards, birthday cards, and the pages of my own book write etc. Some 'examples' of my requiered "make your own Christmas and birthday card ' in size: 10 x 7 inches, or: 255 x 178"