 |
 |
Hi All,
I have a ListBox, it is displaying items just like a dropdown, may be they are able to do it by using jQuery, I am maintaining the application and not familiar with jQuery. The ListBox displays first time when we put focus on it or by clicking mouse in the list box area, it displays all items normally, if once we select any item from the list and keep the cursor in the same area without firing the blur, then the ListBox is not displaying the remaining items, to display the remaining items to select the user has to keep focus out of the list box then only it displays the remaining items.
Do anybody have any idea to resolve this, I am using Chosen.Jquery.js for the list box, I a don't know how list box behave like a dropdown and how jquery works but I am able to debug by using developer tools, please help me any help like a link or a suggestion or a code snippet can be very helpful and much appreciated. Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
 |
Greetings gurus,
We have a fieldname called descriptions.
All comments are entered into a textbox and submitted to the database.
Problem is that sometimes, comments in the descriptions text box are copied directly from Microsoft Word with quotes and dashes.
These quotes are either single quotes (‘ ’) or double quotes “ ” and in some cases, dashes (-).
In our jquery code, I have this:
myData.descriptions= $("#descriptions").val(); among many fields.
Is there anyway to convert those MS smart tags to normal tags so when my users copy from Word and paste, those tags get converted to normal tags?
Thanks a lot in advance
modified 2 days ago.
|
|
|
|
 |
This might help:
Javascript:
var replaceWordChars = function(text) {
var s = text;
s = s.replace(/[\u2018\u2019\u201A]/g, "\'");
s = s.replace(/[\u201C\u201D\u201E]/g, "\"");
s = s.replace(/\u2026/g, "...");
s = s.replace(/[\u2013\u2014]/g, "-");
s = s.replace(/\u02C6/g, "^");
s = s.replace(/\u2039/g, "<");
s = s.replace(/\u203A/g, ">");
s = s.replace(/[\u02DC\u00A0]/g, " ");
return s;
}
C#:
public static string ReplaceWordChars(this string text)
{
var s = text;
s = Regex.Replace(s, "[\u2018\u2019\u201A]", "'");
s = Regex.Replace(s, "[\u201C\u201D\u201E]", "\"");
s = Regex.Replace(s, "\u2026", "...");
s = Regex.Replace(s, "[\u2013\u2014]", "-");
s = Regex.Replace(s, "\u02C6", "^");
s = Regex.Replace(s, "\u2039", "<");
s = Regex.Replace(s, "\u203A", ">");
s = Regex.Replace(s, "[\u02DC\u00A0]", " ");
return s;
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
 |
Richard,
Thank you very much sir; exactly what I was looking for.
|
|
|
|
 |
Message Removed
modified 21-Jan-15 16:15pm.
|
|
|
|
 |
Hi,
I have couple of divs and spans are inserted within one another, but in a particular situation I want to make inner div visible or show when outer div is hidden or invisible. Please help me with this regard. Here is the code snippet for it.
Where the condition if (event.target.checked) outer div WaitListDiv is hidden and then I want to show the OptOutDiv inner div, but it is not showing up, please let me know if there is anyway to resolve this issue. I have tried all those options which are commented and un-commented. When I tried with the code OptOutDiv.show("fast"); then it gave me error "uncaught typeerror undefined is not a function" on the browser debugging.
Thanks in advance.
Here is the element
<div class="my-section" id="WaitListDiv">
<p>
It is recommended that this child be placed on a waiting list as soon as possible. This allows all ELMS
users at the Waiting List site(s) the ability to provide services to the child in a more timely fashion.
</p>
<div id="OptOutDiv">
<asp:CheckBox ID="chkOptOut" runat="server" Text="Parent Does Not Wish to Add Child to Waiting List" AutoPostBack="true" />
<span id="spnOptOutReason" runat="server">
<asp:Label ID="lblOptOutReason" runat="server" AssociatedControlID="txtOptOutReason" Text="Reason:" />
<asp:TextBox ID="txtOptOutReason" runat="server" DataField="OptOutOfWaitListReason" DataType="PrescreenData" />
<asp:Button ID="btnSaveReason" runat="server" Text="Save Opt Out Reason" />
</span>
</div>
<elms:AvailableWaitingLists runat="server" ID="waitList" />
</div>
Here is javascript/jquery code
optOut: function (event) {
var waitListDiv = $("[id$='grdWaitList']").closest("div.my-container");
if (event.target.checked) {
waitListDiv.hide("fast");
var j = jQuery.noConflict();
j('#OptOutDiv').show("fast");
j('#spnOptOutReason').show("fast");
} else {
waitListDiv.show("fast");
$("[id$='spnOptOutReason']").hide("fast");
if ($("[id$='txtOptOutReason']")[0].value != "") {
$("[id$='txtOptOutReason']")[0].value = "";
ELMS.Common.sneakySave($("[id$='chkOptOut']")[0].name, true, ELMS.Page.sneakySave_Callback, ELMS.Page._originalOptOutCallback);
}
}
},
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
 |
Please do not use these forums to advertise your articles, especially when posted on other sites. If you wish to publish it on CodeProject then read the Posting Guidelines[^].
|
|
|
|
 |
Hello i i have this thing here http://jsfiddle.net/Trolstover/qxd32hkk/15/[^]
What i expect it to do is when you click on the Td element , it hide "..." and shows full word and vice versa , the problem is , that in my code it works randomly on elements, also if you fast click on elements , it gets bugged (it will show both "..." and full word at the same time)
How can i fix my code?
|
|
|
|
|
 |
Hi , thanks for answer , try to click on one element multiple times , and also try all elements you will see the bug
|
|
|
|
 |
It runs multiple times and blinks
I can't tell what the problem is, in other words the line of code at fault.
But I can tell you that it's sort of like non-async code, in which code runs straight through until it's done.
And your animation is like async, in which the animation must complete before the next line of code executes. You need some point of measurement to tell when the animation is complete.
I made a filmstrip and ran into the same problem. The principals are similar, but not the same.
[edit] - Consider my filmstrip, details in the article.
Display Advertising Filmstrip[^]
modified 16-Jan-15 13:04pm.
|
|
|
|
 |
Hi,
I have a popup coming from a link on that popup I have a link that opens tooltip, when I click on anywhere on the popup, the tooltip closes which is perfect. But when I close the popup, unfortunately tooltip doesn't close, this is happening in IE browser.
I found the reason why it is happening, but I still don't know work around, because I am new to JQuery.
The reason is Popup is created and closed by using Popup.js file where as Tooltip is created and closed by some other xxx.js file. Then I tried to copy the Tooltip closing code and pasted it in Popup closing code, but then if we click close button on Popup, then Tooltip is closing but Popup is never closing at all.
Can somebody please help me any advice or link or suggestion or code snippet will be very helpful. Its urgent please help me, thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
 |
That's interesting. So the Tooltip doesn't know that the modal display is no longer active? I've never bother to used the tooltip in a model display.
So which tooltip are you using, the one associated with asp.net objects? or is it a plugin as well?
You would have to reverse engineer the HTML that the tooltip produces, and look for a common denominator like the class name, id prefix, or element name, in order to use jquery to loop the common denominator and destroy them or something.
[edit]
I did the demo here on tooltip, looks like the asp.net object uses the tooltip attr to generate a title attr. Could not find the mechanics on how the browser knows to take a title and generate a tooltip out of it.
http://www.w3schools.com/aspnet/showaspx.asp?filename=demo_prop_webcontrol_standard_tooltip[^]
|
|
|
|
|
 |
Hi,
They are using a different kind of tooltip, actually its a form only opens by using jquery but it functions just as tooltip. When I asked them why are you using this type of implementation the answer came up as they wanted to copy the content of the tooltip.
Weird kind of implementation I am banging my head to actually understand the UI, when they use lot of jquery and javascript.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
 |
In the javascript i would like to save the uploaded file in the solution explorer folder after previewing.
here is the code:
<script type="text/javascript" >
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#imgPreview').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#FileUploadImage").change(function () {
readURL(this);
});
</script>
|
|
|
|
|
 |
I think the getJSON should be taking the JSON URL and returning it as a response - The data file has Author x3 Body x3 and Title x3. Once it has this it should map it into the nodes and give me three nodes for each section of data.
However currently its giving me the console.log output that I have below and nothing in my nodes var.
Console Log:
script.js:7 [Object, Object, Object]0: Object1: Object2: Objectlength: 3__proto__: Array[0]
Code:
$(document).ready(function(){
var url = "assets/js/data.json";
$.getJSON(url).done(function(response) {
var nodes = response.map(function(i) {
return $('<div>').append(
$('<div>', {class: 'title'}).text(i.title),
$('<div>', {class: 'author'}).text(i.author),
$('<div>', {class: 'body'}).text(i.body)
);
console.log(response);
});
});
});
|
|
|
|
 |
without the json file it is hard to say.
it looks like it is malformed.
|
|
|
|
 |
I am performing a basic calculation using javascript and when I use this combination of number it won't calculate correctly: alert((40071.13 + 6028.91) - 46100.04); It should calculate to 0 but it doesn't. All other number combinations work for me. Help!
|
|
|
|
|
 |
hell sir/mam,
i need to advance cricket games source code in .net or java ,php,android in any technologies used
kindly help you...
|
|
|
|
 |
"Sure Sir, do you want fries with that?"
Please note that it won't work this way. You need to show some effort and ask specific question where you are stuck.
Good luck!
Your time will come, if you let it be right.
|
|
|
|
 |
Have you tried anything?
Start off with something and then post queries here.
|
|
|
|
 |
Greetings, experts,
I have this code:
<div id="ExistingRequest">
<div>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("#doit").dataTable( {
"sProcessing" : true,
"sDom":'T<"clear">',
"sJQueryUI": true,
"aaSorting": [[ 1, "desc" ]],
"sPaginationType": "full_numbers",
"sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>',
"sAjaxSource" : "getUserRequests.php?loginName=<?php echo $user; ?>",
"sAjaxDataProp" : "",
"sDestroy" : false,
"sScrollXInner": "110%",
"fnServerData" : function(sSource, aoData, fnCallback) {
request = $.ajax({
"dataType" : "json",
"type" : "GET",
"url" : sSource,
"data" : aoData,
"success" : fnCallback
});
},
"aoColumns" : [
{ "mDataProp": "RequestID", "sWidth": "50px", sSortable: true,
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj)
{
return "<a target='tab' data-tab-name='#RequestDetails' data-tab-index='1' href='getRequestDetails.php?loginName="
+ <?php echo json_encode($user); ?>
This which is more like the Summary page and when a user clicks on any RequestId, it opens up request details, is my code
Then this code that produced this result:
<script type='text/javascript'>$(function(){
$("#doit").on("click", function () {
var data = [{
RequestID: 1234,
RequestInitiatedDate: '01/01/2000',
RequestStatus: 'OK',
RequestClosedDate: '31/12/2000',
WONo: '25728',
WOStatus: 'In Design',
WONote: 'Project is too risky',
WOInitiatedDate: '12/17/2014',
ProjectedFinishDate: '04/16/2015'
}];
$.each(data[0], function (key, value) {
$("#tableRequestSummary td[name='" + key + "']").html(value);
$("#tableRelatedWorkActivity td[name='" + key + "']").html(value);
});
$("#divResultsSummary").show();
$("#divResultsRelatedWorkActivity").show();
});
});</script>
</head>
<body>
<button id="doit" type="button">Do it Easy</button>
<div id="divResultsSummary" style="display:none">
<div>Request</div>
<div>
<table id=tableRequestSummary border=1>
<tr><td>Request ID</td><td name=RequestID></td><td>Request Initiated Date</td><td name=RequestInitiatedDate></td></tr>
<tr><td>Request Status</td><td name=RequestStatus></td><td>Request Closed Date</td><td name=RequestClosedDate></td></tr>
</table>
</div>
</div>
<p>some text here... some text here... some text here... some text here... some text here... some text here...</p>
<div id="divResultsRelatedWorkActivity" style="display:none">
<div>Related Work Activity</div>
<div>
<table id=tableRelatedWorkActivity border=1>
<tr><td>WO #</td><td name=WONo></td><td>WO Initiated Date</td><td name=WOInitiatedDate></td></tr>
<tr><td>WO Status</td><td name=WOStatus></td><td>Projected Finish Date</td><td name=ProjectedFinishDate></td></tr>
<tr><td>WO Note</td><td name=WONote colspan=3></td></tr>
</table>
</div>
</div>
I would like to integegrate this code which produces the result in the demo below into my code above:
http://jsfiddle.net/
Is this possible?
I apologize for the long code.
Thank you very much
|
|
|
|
 |
Good afternoon, i am a french student in France and i am studying informatics . For validating my term at the beginning of January i have a projet in JAVA to do called YAHTZEE. It's a game which i have to code WITHOUT USING AN OBJECTS. I already started the coding, i did all the beginning stuff ( to call the number and the names of players, to roll the 5 dices, i made the code for all the scoring points too(rules) ) but i can't do the table score which updates the new scores after each turn ( 3 turns in total) . So can someone please help me with that ?? Thank you very much .
|
|
|
|
 |
Please use the correct forum, and provide a clearer description of what help you need.
|
|
|
|
 |
Hello gurus,
Isn't there way to concatenate two fields with + and
I have a field called Address that displays data as follows:
1234 Mantra Way
Then I have a building with value Building 1234
How can I concatenate the two so results display like the following:
1234 Mantra Way
Building 1234
This is what I have and it is causing an error:
function v(id){ return $("#"+id).val(); } function v(id){ return $("#"+id).val(); } function CallService() {
var myToken = v("token");
var myData = {
Address : v("Address") + '
' + v("building"),
|
|
|
|
 |
If that is your actual code, then I would guess that the problem is your literal newline character in the string between values. Javascript doesn't support doing that, so you will have to use '\n' to break the line instead:
var myData = {
Address : v("Address") + "\n" + v("building"),
You appear to have repeated the "v" function definition too, which could cause confusion when someone comes back to look at the code.
|
|
|
|
 |
Message Removed
-- modified 2-Jan-15 4:34am.
|
|
|
|
 |
i am so totally confused by your solution.
|
|
|
|
 |
Your Error Fire At Return $("#"+id).val() javascript Can't get this Type Of Value So I Have Use var Id1 ="#"+id //Append Value And Return $(id1).val() //Get Value Of It
|
|
|
|
 |
I am using the bgiframe.js library file in my project for a context menu. I know the the $.browser object has been deprecated so I am using the jquery-migrate-1.2.1.js file declared before the bgiframe.js file as shown below and am using it in the code below. This said I am still getting the "jQuery error: JavaScript runtime error: Unable to get property 'msie' of undefined or null reference" error in the bgiframe.js file when access to the $browser is called. Can anyone help?
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/superfish.js"></script>
<script type="text/javascript" src="../js/hoverIntent.js"></script>
<script type="text/javascript" src="../js/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="../js/bgIframe.js"></script>
$(document).ready(function(){
$("ul.nav")
.superfish({
animation : { opacity:"show",height:"show"}
})
.find(">li:has(ul)")
.mouseover(function(){
$("ul", this).bgIframe({opacity:false});
})
.find("a")
.focus(function(){
$("ul", $(".nav>li:has(ul)")).bgIframe({opacity:false});
});
});
|
|
|
|
 |
The problem was that bgiframe.js was being referenced in multiple places. What I did was add the jquery-migrate-1.2.1.js reference below the jquery.js reference in every place it was referenced. Thanks for everyone's help.
Steve
|
|
|
|
 |
I did a slider but does not seem to pop the top menu
|
|
|
|
|
 |
How can we help?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
Hi all,
I am trying to make a auto blinking div but while trying to achieve using setTimeout its saying " this.off is not a function" in on method I tried two variations.
Please help !!!
var Light = function(color) {
this.color = color;
};
Light.prototype = {
ref:null,
defColor:'black',
on:function(){
if(this.ref != null){
this.ref.css('background-color',this.color);
window.setTimeout(function(){this.off()}, 5000);
}
},
off:function(){
if(this.ref != null){
this.ref.css('background-color',this.defColor);
window.setTimeout(function(){this.on()}, 5000);
}
}
};
var l1;
$(document).ready(function(){
l1 = new Light('red');
l1.ref=$('#mydiv');
l1.on();
});
|
|
|
|
 |
When the anonymous function you've passed to window.setTimeout is called, this will be pointing to the global scope, rather than the specific object instance that called setTimeout . This is one of the confusing quirks of javascript code.
There are several possible solutions in the answers to this SO question[^]. For example:
- Save the outer
this reference:
var me = this;
window.setTimeout(function(){me.on()}, 5000);
- For modern browsers, use the built-in
bind function[^]:
window.setTimeout(this.on.bind(this), 5000);
- Use jQuery's
proxy method[^]:
window.setTimeout($.proxy(this.on, this), 5000);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
 |
$("#button1").val() + $("#button2").val();
However, what you asked doesn't really make any sense. Button's don't really have values. Perhaps you mean something like a calculator where you have buttons for numbers?
If so, then on each click of a button add to the value in the textbox.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
how to bind data to infragistics webhierarchicaldatagrid through javascript
im having data in datatable i need to bind this dt to webhierarchicaldatagrid
this is the
<ig:WebHierarchicalDataGrid ID="whdg1" runat="server"
AutoGenerateColumns="false" AutoGenerateBands="false" InitialExpandDepth="0" DataKeyFields="CenterID"
InitialDataBindDepth="0" Height="500" Width="100%">
|
|
|
|
 |
Have you asked Infragistics?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
Hi,
I am using dynamic datetimepicker that the user can add to any number. But I am having postback problem. Once I submit it, the return page should have all the submitted values including those added dynamic datetimepicker. Right now when i submit and when the page returns, all other static controls with data are there but no dynamically added datetimepicker controls.
Below is the code I used to add datatimepicker dynamically using javascript:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<link rel="stylesheet" media="all" type="text/css" href="jquery-ui.css" />
<link rel="stylesheet" media="all" type="text/css" href="jquery-ui-timepicker-addon.css" />
<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
<script type="text/javascript">
$(function () {
var counter = 1;
jQuery("#<%= btnD1Add.ClientID %>").click(function (event) {
event.preventDefault();
jQuery("<li>").appendTo(".Date1More");
jQuery("<label id='lblD1StartTime" + counter + "'>StartTime:</label><input type='text' id='txtD1StartTime" +counter + "' name='txtStartTime1'/>").timepicker({
hourGrid: 10,
minuteGrid: 10,
timeFormat: 'hh:mm tt'
}).appendTo(".Date1More");
counter++;
});
});
</script>
<asp:Button ID="btnD1Add" runat="server" Text="Add more time slots" />
<li>
<ul class="Date1More">
</ul>
</li>
</html>
Now how to use postback for these controls? I had tried to use following code in code but didn't work. I even tried it using !Ispostback() function under pageLoad but no effect.
protected string[] txtStartTime1;
protected void Page_Load(object sender, EventArgs e)
{
txtStartTime1 = Request.Form.GetValues("txtStartTime1");
}
protected void Page_Init(object sender, EventArgs e)
{
try
{
if (txtStartTime1.Length > 0)
{
TextBox txtStTime1 = new TextBox();
txtStTime1.ID = "txtD1StartTime";
txtStTime1.CssClass = "timepicker";
this.Controls.Add(txtStTime1);
}
}
catch(Exception ex){}
}
Is there any another way to do it?
Please help..
Dhyanga
|
|
|
|
 |
To understand this behaviour you need to understand page life-cycle properly. I can't explain the whole stuffs here but would recommend you to read it.
Dhyanga wrote: Is there any another way to do it?
Yes, you can very well avoid postback by using ajax or PageMethods. Just see which is best suited in your scenario.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
 |
Thank you very much Anurag. I don't know why I didn't think of using Ajax before I spent lots of time thinking on this.
Dhyanga
modified 5-Dec-14 11:17am.
|
|
|
|
 |
You are welcome.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
 |
I hope this is the most appropriate forum...
To people (perhaps) with experience doing things like this - does this even sound possible?
I'm having to do a bit of translation work, and I'm using Google Translate a lot (in Chrome). It would be really handy to be able to have four translation boxes on one page (e.g., English to Spanish at the top, and below that, Spanish to English), with buttons to transfer the text back and forth. That would make it far easier to check the back translation.
Might I be able to do such a thing with a user script? And can anyone point me at the best resources for developing these in Chrome? Cheers!
|
|
|
|
|