Click here to Skip to main content
15,880,469 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: How can I minimize the entire browser? Pin
Peter_in_278011-Jul-21 22:19
professionalPeter_in_278011-Jul-21 22:19 
QuestionRe: How can I minimize the entire browser? Pin
SeeSharp219-Jul-21 9:46
SeeSharp219-Jul-21 9:46 
QuestionWant to achieve web page timing become focus execution Pin
Member 1528061310-Jul-21 13:09
Member 1528061310-Jul-21 13:09 
Rant[REPOST] Want to achieve web page timing become focus execution Pin
Richard Deeming11-Jul-21 22:08
mveRichard Deeming11-Jul-21 22:08 
QuestionWant to achieve web page timing become focus execution Pin
Member 152806137-Jul-21 15:20
Member 152806137-Jul-21 15:20 
QuestionHow do I get my input box to persist after clicking Amend? (SOLVED) Pin
samflex3-Jul-21 6:15
samflex3-Jul-21 6:15 
Greetings experts,

I have a two part question but first what I am trying to accomplish and what I have tried so far.

Currently, we have a button on our web page with an Amend. value.

When you click the Amend button, a textbox is displayed which allows users to enter whatever text they wish to enter.

If user changes his/her mind after clicking Amend, users can click Cancel to hide the textbox again.

This works well.

The original intent is to allow users to enter data as an amendment to existing data and submit to the database.

Here is the working code:

//JS
            $("#btconsultsup").click(function () {
              if ($(this).val().toLowerCase() == "amend") {
                  $.each($('.consultsup'), function(i, item){
                  $(this).show();
                });
                $(this).val("Cancel");
            } else {
                  $.each($('.consultsup'), function(i, item){
                  $(this).hide();
                });
                $(this).val("Amend");
            }
          });
          


//HTML
     <input id="btconsultsup" type="button" value="Amend" name="btconsultsup" />
    <div class="consultsup" style="display: none"><input class="shortCosts"  id="amendconSupportContractCosts" name="amendconSupportContractCosts" value=""/></div>


However, management has decided that once data is entered into this textbox, (A), once you click Amend button to display the textbox, then Cancel button should be hidden because they want the textbox to display permanently on the page even after the page is closed and reopened; and (B), data should displayed permanently on that textbox.

So, how do I hide the Cancel button so it will no longer be available to users to click on it to hide the textbox once it is already displayed?

Two, how do I ensure that once the Amend button is clicked and textbox is displayed, that it remains displayed even after the page is closed and reopened.

I had suggested to them that the best solution is to just add the textbox to the page without the need for Amend button but they refused.

Any suggestion is greatly appreaciated.

modified 5-Jul-21 9:49am.

AnswerRe: How do I get my input box to persist after clicking Amend? Pin
Richard Deeming4-Jul-21 21:41
mveRichard Deeming4-Jul-21 21:41 
GeneralRe: How do I get my input box to persist after clicking Amend? Pin
samflex5-Jul-21 2:41
samflex5-Jul-21 2:41 
GeneralRe: How do I get my input box to persist after clicking Amend? Pin
Richard Deeming5-Jul-21 2:47
mveRichard Deeming5-Jul-21 2:47 
GeneralRe: How do I get my input box to persist after clicking Amend? Pin
samflex5-Jul-21 3:24
samflex5-Jul-21 3:24 
GeneralRe: How do I get my input box to persist after clicking Amend? Pin
Richard Deeming5-Jul-21 3:39
mveRichard Deeming5-Jul-21 3:39 
GeneralRe: How do I get my input box to persist after clicking Amend? Pin
samflex5-Jul-21 3:49
samflex5-Jul-21 3:49 
Questionjs problem Pin
tkshitiz30-Jun-21 22:13
tkshitiz30-Jun-21 22:13 
AnswerRe: js problem Pin
Richard MacCutchan30-Jun-21 22:15
mveRichard MacCutchan30-Jun-21 22:15 
QuestionA button at html to trigger an autoplay audio at exact time Pin
Member 1526543827-Jun-21 23:42
Member 1526543827-Jun-21 23:42 
QuestionRe: A button at html to trigger an autoplay audio at exact time Pin
Richard MacCutchan28-Jun-21 0:06
mveRichard MacCutchan28-Jun-21 0:06 
AnswerRe: A button at html to trigger an autoplay audio at exact time Pin
Member 1526543828-Jun-21 0:11
Member 1526543828-Jun-21 0:11 
GeneralRe: A button at html to trigger an autoplay audio at exact time Pin
Richard MacCutchan28-Jun-21 0:24
mveRichard MacCutchan28-Jun-21 0:24 
AnswerRe: A button at html to trigger an autoplay audio at exact time Pin
Richard Deeming28-Jun-21 4:06
mveRichard Deeming28-Jun-21 4:06 
GeneralRe: A button at html to trigger an autoplay audio at exact time Pin
Member 1526543828-Jun-21 22:11
Member 1526543828-Jun-21 22:11 
GeneralRe: A button at html to trigger an autoplay audio at exact time Pin
Richard Deeming28-Jun-21 22:25
mveRichard Deeming28-Jun-21 22:25 
QuestionHow to merge to javascripts to test in console? Pin
ajaszin18-Jun-21 14:52
ajaszin18-Jun-21 14:52 
AnswerRe: How to merge to javascripts to test in console? Pin
Richard Deeming20-Jun-21 23:45
mveRichard Deeming20-Jun-21 23:45 
GeneralRe: How to merge to javascripts to test in console? Pin
DerekT-P21-Jun-21 9:22
professionalDerekT-P21-Jun-21 9:22 
GeneralRe: How to merge to javascripts to test in console? Pin
Richard Deeming21-Jun-21 21:49
mveRichard Deeming21-Jun-21 21:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.