#input alignment in html

6 messages · Page 1 of 1 (latest)

peak imp
#

Hi I am attaching the sample code here

In this when I press the first button it should display the message inside the form box by breaking the line and not as a single line

Any solution

P.S. I wrote it in inline CSS for testing

<div id = "sumesh" style="position:absolute;top: 50%;left:50%;transform: translate(-50%,-50%);height: 500px;width: 900px; border: 1px solid black;display:none;">
<form>
<label style="text-align-last: center;">JSON Response</label><br>
<input type="text" id="response" name="response" style="position:absolute;top: 50%;left:50%;transform: translate(-50%,-50%);height: 400px;width: 700px; border: 1px solid black; word-wrap: break-word;
word-break: break-word;break-word;overflow: scroll;">
<button name ="Add" onclick="cliq()" style="position:absolute;top: 95%;left:95%;transform: translate(-50%,-50%);height: 35px;width: 70px;">Add</button>
</form>
</div>
<script>
function cli()
{
var responseData ='hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii';
// var data = JSON.parse(responseData);
// data.result[0]
document.getElementById("sumesh").style.display="block";
document.getElementById("response").value=responseData;
document.getElementById("sum").style.display="block";
// cliq(responseData);
}

sturdy cargoBOT
#

This post has been reserved for your question.

Hey @peak imp! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

waxen needle
#

this is not Java lol

#

but try to use a textarea insted of an input if you need multiple lines

peak imp
#

Thank you ....and sorry 😅