|
Something like this maybe.
("#textbox").validate({
rules: {
txt1: {
required: function () {
return $("#leftTextbox").is(':not(:blank)';
}
}
}
}
|
|
|
|
|
Awesome thank you.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
I have the following code in my website.
<div class="divColumn">
<div>
<img alt="Flags - Flagstick Locks" width="150" height="94" src="images/flagstick_locks.jpg" />
<br />
<script type="text/javascript">
// Popup window code
function newPopup(url) {
popupWindow = window.open(
url, 'popUpWindow', 'height=500,width=600,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')}
</script>
<a href="JavaScript:newPopup('/flagstick_locks_buy.aspx');">Flags - Flagstick Locks (Pair)</a>
</div>
</div>
This should display a popup window, and everything works fine when running as localhost on my PC. However, when I upload the page to my hosting company, the code returns a 404 error - The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
I have double checked my files have been uploaded and they have, so why am I getting this error.
Any suggestions greatly appreciated.
Thx
|
|
|
|
|
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
|
|
|
|
|
I'm confused here.
A dropdown is like a 1 line textbox, and with focus, will present a list of items below the textbox.
A listbox is like a multi row textbox in which you can set the height, and can be scrolled to view the list of items.
They have option elements that make up the the items.
So your saying which one displays first?
FYI
I dumped all my listbox elements last year and replaced them with radio button list.
I noticed over the years, that the listbox is dead.
Now if I need a listbox, i just create a panel, and populate it with more panels that scroll vertical,
|
|
|
|
|
Sounds good, thank you for your information, yeah I appreciate your help and every one has different approaches to write UI code, that's why I hate client side scripting all in total, I don't prefer it if I architect and application, try to do a lot using server side controls rather than client side, the other reason it is irritating is client side scripts don't have a nice debugger to see what's going on, IE developer tools is the worse.
but I resolved the issue, it was in jquery file the error was, once we select an item it was just hiding the other ones until blur fires, I removed that hiding so the 2nd item is visible after selecting the first until we blur from there that should be the expected behavior.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
I shifted most of my code to the client side about 3 years ago. I use to write just server side code, but it was too much traffic to the web servers. So I decided to just use the clients CPU and memory instead.
If you didn't write it, it's hard to fix. There's a lot of sloppy jquery out there. The there are layers and layers of div elements on top of each other, and finding the right one is hard to do. Firefox inspect element is pretty good, you can change the values of HTML in the DOM, and see the results instantly to get an idea of what to look for.
You pretty good with responsive designs?
I know you have been coding MVC for years now, I'm going to start my first MVC project this week.
Wondering if the technology is worth the investment in time. Sometimes Microsoft makes things that die in 5 years, like Silverlight.
|
|
|
|
|
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 26-Jan-15 18:50pm.
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|