Click here to Skip to main content
14,271,871 members

JavaScript

 
QuestionHow do I a value from one function and pass it through to another for use Pin
Member 1028754813-Aug-19 11:13
memberMember 1028754813-Aug-19 11:13 
AnswerRe: How do I a value from one function and pass it through to another for use Pin
Richard MacCutchan13-Aug-19 21:33
protectorRichard MacCutchan13-Aug-19 21:33 
AnswerRe: How do I a value from one function and pass it through to another for use Pin
rinave19-Aug-19 15:58
memberrinave19-Aug-19 15:58 
AnswerRe: How do I a value from one function and pass it through to another for use Pin
ZurdoDev21-Aug-19 5:36
professionalZurdoDev21-Aug-19 5:36 
GeneralRe: How do I a value from one function and pass it through to another for use Pin
Richard Deeming21-Aug-19 8:26
mveRichard Deeming21-Aug-19 8:26 
AnswerRe: How do I a value from one function and pass it through to another for use Pin
ZurdoDev21-Aug-19 5:35
professionalZurdoDev21-Aug-19 5:35 
QuestionComparison's in JavaScript Pin
BobInNJ7-Aug-19 10:57
memberBobInNJ7-Aug-19 10:57 
AnswerRe: Comparison's in JavaScript Pin
ZurdoDev7-Aug-19 11:10
professionalZurdoDev7-Aug-19 11:10 
QuestionMessage Closed Pin
30-Jul-19 11:57
memberSmithMasterJerry30-Jul-19 11:57 
QuestionDelete consumer Pin
Member 1453057115-Jul-19 0:09
memberMember 1453057115-Jul-19 0:09 
AnswerRe: Delete consumer Pin
Richard MacCutchan15-Jul-19 0:42
protectorRichard MacCutchan15-Jul-19 0:42 
QuestionRe: Delete consumer Pin
ZurdoDev7-Aug-19 11:08
professionalZurdoDev7-Aug-19 11:08 
QuestionLooking for Bootstrap, TypeScript,Vue and Vue Router Guide to Building a Navigation Bar Pin
Jammer29-Jun-19 2:45
memberJammer29-Jun-19 2:45 
AnswerRe: Looking for Bootstrap, TypeScript,Vue and Vue Router Guide to Building a Navigation Bar Pin
Afzaal Ahmad Zeeshan30-Jul-19 5:37
mveAfzaal Ahmad Zeeshan30-Jul-19 5:37 
Questionhow to open word file in client side Pin
Member 1447396626-Jun-19 1:32
memberMember 1447396626-Jun-19 1:32 
AnswerRe: how to open word file in client side Pin
Richard MacCutchan26-Jun-19 1:45
protectorRichard MacCutchan26-Jun-19 1:45 
QuestionMessage Closed Pin
16-Jun-19 21:53
memberMember 1447282216-Jun-19 21:53 
Question(SOLVED) How to activate button on mouse press? Pin
samflex6-Jun-19 4:39
membersamflex6-Jun-19 4:39 
Greetings again experts,

We have a requirement that when our web app loads, by default, the submit button is disabled:

Here is how I handled that:

<asp:Button runat="server" id="btnSubmit" style="width:120px;padding: 0; border: 0;background-color:#D8D8D8 !important;color: #808080; height:30px;" Text="Generate Report" OnClick="btnSubmit_Click" Enabled="false" />


Then we have six search textbox controls.

When a user enters a value of at least three characters into any of the textboxes, then the submit button is activated.

Here is the script that I am using for that:

script type="text/javascript">

//function to enable button if two textboxes contains text
function SetButtonStatus(sender, target) {
var uuid = document.getElementById('<%=suuid.ClientID %>');
var calllist = document.getElementById('<%=caller_list_id.ClientID %>');
var phone = document.getElementById('<%=phonenumber.ClientID %>');
var startdate = document.getElementById('<%=date_start.ClientID %>');
var enddate = document.getElementById('<%=date_end.ClientID %>');
var calltype = document.getElementById('<%=call_type.ClientID %>');

//Condition to check whether user enters text in a two textbox or not
if ((((((sender.value.length >= 3 || uuid.value.length >= 3) || (sender.value.length >= 3 || calllist.value.length >= 3) || (sender.value.length >= 3 || phone.value.length >= 3)  || (sender.value.length >= 3 || startdate.value.length >= 3)  || (sender.value.length >= 3 || enddate.value.length >= 3)  || (sender.value.length >= 3 || calltype.value.length >= 3))))))
document.getElementById(target).disabled = false;
else
document.getElementById(target).disabled = true;
}
</script>


On each of the six search boxes, I call this function like this (just one textbox as an example):
<asp:TextBox id="phonenumber" style="width:150px;" class="form-control" onkeyup="SetButtonStatus(this,'btnSubmit')" runat="server" />


This works good so far.

The issue we are having is that when a user enters value via mouse, then submit button is not activated.

Most users have their autoComplete on such that when a user has entered a value before, next time s/he wishes to use that value again, s/he simply double click the search textbox and selects a pull down value with his/her mouse.

In this case, the button does not get activated.

I am trying to use the following script so submit button can be activated when mouse click on any textbox is detected:

    <script type="text/javascript">
     $(document).ready(function() {
     $("input").keypress(function(e) {
      if (e.which == 254) {
       $('#btnSubmit').click();
      return false;
     }
    return true;
  });
});
</script>


It still does not work as the submit button remains disabled.

I tried keycode===13 and still no love.

Any ideas how I can resolve this?

Thanks a lo in advance

modified 6-Jun-19 12:05pm.

AnswerRe: How to activate button on mouse press? Pin
Richard Deeming6-Jun-19 5:39
mveRichard Deeming6-Jun-19 5:39 
GeneralRe: How to activate button on mouse press? Pin
samflex6-Jun-19 6:24
membersamflex6-Jun-19 6:24 
GeneralRe: How to activate button on mouse press? Pin
samflex6-Jun-19 7:21
membersamflex6-Jun-19 7:21 
GeneralRe: How to activate button on mouse press? Pin
Richard Deeming6-Jun-19 8:03
mveRichard Deeming6-Jun-19 8:03 
GeneralRe: How to activate button on mouse press? Pin
samflex6-Jun-19 9:47
membersamflex6-Jun-19 9:47 
Questionhow to count product codes from textarea? Pin
Veltix26-May-19 4:11
memberVeltix26-May-19 4:11 
AnswerRe: how to count product codes from textarea? Pin
jkirkerx27-May-19 11:14
professionaljkirkerx27-May-19 11:14 

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.