Display in input text instead of div - google-maps

I follow the http://gmaps-samples-v3.googlecode.com/svn/trunk/geocoder/getlatlng.html
instead of displaying the 'latlng' in ,
how do i display it in

If I understand your question correctly (.ie the lat/long value is appearing in the div below the map and you want it to appear in the input text field at the top) then you should change the following line of Javascript (Line 75)
document.getElementById('latlng').innerHTML = latlng;
to
document.getElementById('address').value = latlng;

Related

trying to set the text above the Image in ImageTextButton on libGdx

i'm using LIBGDX.
i'm trying to set a text string in the center of an image, and use it as a clickable button.
unfortunately i didn't find a solution for it.
Yes you can with the getLabel method:
myButton.getLabel().setAlignment(Align.center);
https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/utils/Align.html
By default, ImageTextButton contains 2 Actors in 1 row: Image then Label. To change position of the Label one may rebuild the underlying table cells just after creation of ImageTextButton:
new ImageTextButton(...) {
val label = getLabel
val image = getImage
clearChildren()
add(image)
row() // second row
add(label)
}
Now Label will be under the Image. Code is Scala.

Displaying more than one content in a cell in asp.net

I have a cell and want to display 'hello' in the middle and if some condition is true then display 'world' at the right bottom of that cell.
Here, Only hello and world is getting displayed but 'world' not at the right bottom.
tc.InnerHtml = "Hello";
if(some condition)
{
Label lblBundle = new Label();
lblBundle.Style.Add("font-size", "5px");
lblBundle.Style.Add("float", "right");
lblBundle.Style.Add("float", "bottom");
lblBundle.Text = "world";
tc.Controls.Add(lblBundle);
}
Can anyone please help me out. I am displaying the label control dynamically.
if you want to append just word to existing content than why you need to add label. try following:
tc.InnerHtml = tc.InnerHtml + " world"

AS3 TextField: Append text at a certain line?

I'm trying to find a way to append text (appendText) at a certain TextField line number.
I found a way to return the first character of a line:
tf.text.charAt(tf.getLineOffset(10)); //selects line 10
But I haven't found a way to append text. Any help would be appreciated!
This should do the trick (put the supplied text at the start of the supplied line), though there may be a more efficient way of doing it.
function prependToLine(textField:TextField, line:int, text:String):void {
var lineOffset:int = textField.getLineOffset(line-1);
textField.text = textField.text.substring(0,lineOffset) + text + textField.text.substr(lineOffset);
}

Retain newline when getting contenteditable div text

I wanted to save the text inside a contenteditable div being pre formatted. How would i get the pre form of the text and not the text where \n and \r are ommitted?
$('#save').click(function(e) {
var id = "board_code";
var ce = $("<pre />").html($("#" + id).html());
if ($.browser.webkit)
ce.find("div").replaceWith(function() { return "\n" + this.innerHTML; });
if ($.browser.msie)
ce.find("p").replaceWith(function() { return this.innerHTML + "<br>"; });
if ($.browser.mozilla || $.browser.opera || $.browser.msie)
ce.find("br").replaceWith("\n");
alert( ce.text() );
});
http://jsfiddle.net/AD5q7/10/ this doesnt work
try string for contenteditable div
UPDATE: try the string by typing it. There maybe no problem when the string is pasted.
1
abc def
gh i
jkl
2
#include<iostream.h>
#include<conio.h>
int main(){
int grade, passingMark=75;
cout<<"Hi there, please enter your mark: ";
cin>>grade;
if( ((grade >= passingMark)||(grade==35)) && (grade<101)){
cout<<"\nPass!";
}
return 0;//15lines
}
The save file must be also formatted like this and not without \n\r removed. Im expecting that the alert should include \n
When contenteaditable div looses focus, the entire text gets converted to html for eg
<div contenteditable="true">Your text is here
and has new line </div>
upon loosing focus it converts the virtual textarea to html i.e.
<div>Your text is here</div><br><div>and has new line </div>
and when you'll attempt .text(), you'll loose the desired alignment as actually the don't exist anymore in that div.
Solution
1. You can use textarea, with border properties set to 0 which would make it look like a contenteditable div or
2. You can grab the entire html of the contenteditable div and replace the html with the corresponding text representations using javascript (for that refer javascript regex replace html chars)
Try this
alert( ce.text().replace(/\n/g, "\\n" ).replace(/\r/g, "\\r"));

Want to get cursor position within textInput

I am using textInput within grid using rendrer. I am populating a suggestion box just below the text input field on the basis of typed character and index of text input.Problem is that if i shrink grid column then suggestion box is not populating at the right place so I want global position of cursor in the text input field .
Something like that:
var inputTxt : TextInput = new TextInput;
var x : Number = inputTxt.cursorManager.currentCursorXOffset;
var y : Number = inputTxt.cursorManager.currentCursorYOffset;
Try using 'global coordinate'.
This might resolve your problem.