Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I display an extra input box for editing an existing data?

Status
Not open for further replies.

chikwendu

Programmer
Nov 4, 2018
5
0
0
US
Greetings mate,

Recently, management asked that we create an extra textbox, copy data from existing textbox into this new texgbox and save the results to the database.

Initially, they asked we create a button called Amend in such that when a user clicks this Amend button, an empty textbox should he displayed to allow that should copy data from existing textbox into this empty textbox and user would then add additional content to this new textbox and save the result to the database.

I came up with the following solutions:

Code:

Existing textbox control id is called suggestedProcess and the new textbox that is displayed after clicking the Amend button is called Amended_Process.

The code above works great.

The issue is that they want this Amended_Process textbox should stay displayed permanently.

This solution is flawed because the newly Amended_Process texbox cannot be displayed permanently because when page is closed, it becomes hidden again until you click the Amend button again.

Any ideas how to come up with Amended_Process textbox that upon clicking the Amend button, creates this new textbox that stays permanently displayed even after the page is closed?

I have been struggling with this for days.

Any suggestions is greatly appreciated.
 
<script type="text/javascript">
$(document).ready(function () {
$("#amended_Process").val($("#suggestedProcess").val());

// Copy on textBox keyup.
$("#suggestedProcess").on('keyup', function () {
$("#amended_Process").val($(this).val());
});
});
</script>


<label>Suggesed Process: </label>
<input id="btnta" type="button" value="Amend" name="btnta" /><br>
<textarea id="suggestedProcess" class="longText" name="suggestedProcess"></textarea>

<div id="dvta" style="display: none">
<label>Amended activities for next year: </label> <br>
<textarea id="amended_Process" class="longText" name="amended_Process"></textarea>
</div>

For some reason, my code did not display in my original post. The code is posted again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top