Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
4,702,221
4,702,222
run event once only
<p>i have code to check for browser and at the moment it is running each time i refresh page. is it possible to run only once on each visit so if i refresh or are taken to that page by link then the code is ignored. thanks</p> <pre><code> &lt;script type="text/javascript"&gt; if($.browser.msie &amp;&amp; $.browser.version=="8.0" || $.browser.msie &amp;&amp; $.browser.version=="7.0") alert("Please upgrade your browser to at least version 8.0 in order to use all the features of this site.\n\nThank you."); &lt;/script&gt; </code></pre> <p>updated code supplied by darin:</p> <pre><code>&lt;script type="text/javascript"&gt; var date = new Date(); date.setTime(date.getTime() + (30 * 60 * 1000)); $.cookie("explorer", "foo",{ expires: date }); var cookie = $.cookie('explorer'); if (cookie == null) { // the cookie is not present =&gt; you may do the checks if ($.browser.msie &amp;&amp; $.browser.version == '8.0') { // set the cookie so that the next time the user visits this page // he doesn't get the alert message $.cookie('explorer', 'true'); alert("Please upgrade your browser to at least version 8.0 in order to use all the features of this site.\n\nThank you."); } } &lt;/script&gt; </code></pre> <p>the alert is not firing though</p>
javascript jquery
[3, 5]
3,256,464
3,256,465
How do I write an extension method in JavaScript?
<p>I need to write a few extension methods in JS. I know just how to do this in C#. Example:</p> <pre><code>public static string SayHi(this Object name) { return "Hi " + name + "!"; } </code></pre> <p>and then called by:</p> <pre><code>string firstName = "Bob"; string hi = firstName.SayHi(); </code></pre> <p>How would I do something like this in JavaScript?</p>
c# javascript
[0, 3]
3,098,773
3,098,774
catch url by javascript
<p>catch url by javascript</p>
java javascript
[1, 3]
958,081
958,082
Create a thumbnail from only part of an image
<p>I'm creating a thumbnail right now like this:</p> <pre><code>// create thumbnail and save var image = Image.FromFile(Server.MapPath(imageFilename)); var thumb = image.GetThumbnailImage(image.Width / 10, image.Height / 10, () =&gt; false, IntPtr.Zero); thumb.Save(Server.MapPath(Path.ChangeExtension(imageFilename, "thumb" + Path.GetExtension(imageFilename)))); </code></pre> <p>All it does is take the image, create a thumbnail 1/10th of the size, and save it.</p> <p>I'd like to be able to create a thumbnail out of only part of the image. So say I have an image that is 200px by 200px. How can I take a 100px by 100px crop out of the middle of the image, and create a thumbnail out of it?</p>
c# asp.net
[0, 9]
5,562,363
5,562,364
Jquery url replace
<p>How can I modify this:</p> <pre><code>/services/type/single_dwelling/ </code></pre> <p>to this:</p> <p><code>/ajax/services/single_dwelling/development</code></p> <p>Currently I have:</p> <blockquote> <p>linkUrl = $(this).attr("href").replace(/(\/(services)\/)/, "$1ajax/");</p> </blockquote> <p>Which outputs:</p> <pre><code>/services/ajax/type/single_dwelling/ </code></pre> <p>I'm a little confused.</p>
javascript jquery
[3, 5]
4,297,167
4,297,168
how do you change the color of a link once clicked, then change it back once another link is clicked?
<p>I have two links inside a div called div A. when link 1 is clicked a div with some info is shown (div B) and when the link 2 is clicked a different div(div C) is shown. This is done using jquery's show/hide.</p> <p>I would like the color of the <strong>selected</strong> link to change and then return only <strong>once the other link is clicked</strong>. therefore highlighting which link the user is currently viewing.</p> <p>Does anyone know how I go about achieving this link color change through Jquery or even PHP. Thank you. All help is greatly appreciated.</p> <p>Javascript</p> <pre><code> $("#link1").click(function() { $("#Div b").hide(); $("Div c").show(); }); $("#link2").click(function() { $("#Div b").hide(); $("#Div c").show(); }); </code></pre> <p>HTML</p> <pre><code>&lt;div id="div a"&gt; &lt;a href="javascript:void(0);" class="links" id="link1"&gt;&lt;/a&gt; &lt;a href="javascript:void(0);" class="links" id="link2"&gt;&lt;/a&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
5,590,949
5,590,950
How to clip text in android canvas?
<p>I'm creating kids learning application in android. I created Imageview on which text is displayed and i applied canvas for Imageview so i can able to paint on whole canvas. Upto this working fine.</p> <p>Now my problem is i have to clip the text present in canvas imageview. I know to clip the region with shapes like Rect , Circle but dont know how to clip the text in android canvas... Also the clipped region must allows me to paint only the clipped region ( not the region other than text view in Imageview .)</p> <p>Help with some sample code is appreciated.</p>
java android
[1, 4]
4,005,566
4,005,567
Changing access modifier of CreateRow method of GridView
<p>Is it possible to change the access modifier in c# asp.net for a dll file. </p> <p>For example, i am trying to use CreateRow of GridView in C# asp.net and the error i get is </p> <p>"System.Web.UI.WebControls.GridView.CreateRow(int, int, System.Web.UI.WebControls.DataControlRowType, System.Web.UI.WebControls.DataControlRowState) is inaccessible due to its protection level"</p> <p>I checked the modifier and it is protected. When i tried to change, it says readonly and cannot be changed. Is it possible?</p> <p>UPDATE: I am trying to get a dataset from database and trying to bind it to gridview. Dataset might have upto 4 rows. If it has any rows less than 4 the remaining rows should be shown empty in the gridview. So i am trying to create 4 empty rows using CreateRow method and then binding each row from the dataset. I hope i am clear! </p> <p>Thank you in advance!! </p>
c# asp.net
[0, 9]
4,221,042
4,221,043
How to access specific div child of certain class?
<p>In my div i have a child div of class "someClass". I want to access that child by classname, not id.</p> <p>EDIT: Only in this particular div, not all the other divs with same classname</p>
javascript jquery
[3, 5]
611,385
611,386
creating self-contained job postings component
<p>we have a job postings page on our web site. Our clients would like to include this job postings page on their web site. This way applicants can directly go to the client site to apply for the jobs rather than being redirected to our site. But when they apply for the job, the information will be saved in our system. How could we achieve this? One way would be to use iframe. But I am not sure if it would be efficient.</p>
javascript asp.net
[3, 9]
525,325
525,326
Why does onLongPress() not return a boolean like all other SimpleOnGestureListener?
<p>As the title states. The fact that I can't consume the event is causing a <code>click</code> event to occur immediately afterwards. Now I am manually keeping track of whether or not a longpress has occurred when handling a potential click.</p> <p>Am I missing something here? I mean, I can't even get around this trying to implement the OnGestureListener interface because it expects a void for <code>onLongPress()</code>. What are my options?</p>
java android
[1, 4]
4,282,278
4,282,279
Action Attribute
<p>I want to send form data to aspx.cs page view below codes.</p> <p>But this error generated:Object reference not set to an instance of an object.</p> <p>Please guide me.</p> <pre><code> &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server" method="post" action="Default2.aspx"&gt; &lt;input id="Text1" type="text" value="dgfdh" runat="server" name="Text1"/&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <hr> <pre><code> protected void Page_Load(object sender, EventArgs e) { TextBox1.Text = Request.Form["Text1"].ToString(); } </code></pre>
c# asp.net
[0, 9]
2,029,204
2,029,205
Error with selected item from the ListBox property (C#)?
<pre><code>for (int counter = 0; counter &lt; countSelected; counter++) { string groupName = txt_GroupName.Text; //Get GroupID from the created group string GroupIDQueryText = "SELECT GroupID FROM tbl_group WHERE GroupName "; int groupID = Convert.ToInt32(server.performQuery(GroupIDQueryText, groupName, MySqlDbType.VarChar)); //To get User ID string firstName = ListBoxMembers.SelectedItems[counter].Value; } </code></pre> <p>This isn't returning the selected value, but instead returns the 1st person in the list even if I haven't selected it. Where am I going wrong? System.Web.UI.WebControls does not contain defenition for listboxmembers.selectedItems error </p>
c# asp.net
[0, 9]
4,030,751
4,030,752
convert this php code to javascript - strpos, str_replace, substr
<p>I have a piece of code written in PHP inside my javascript tag. I figured it would be better to have all javascript inside my script tag.</p> <p>So I would need help to convert these 3 lines of code in javascript:</p> <pre><code>if (strpos($video['thumbs']['master'], '/thumbs_old/') !== false) { $position = strpos($video['thumbs']['master'], '.flv'); $oldFlipBookThumb = str_replace(substr($video['thumbs']['master'], $position), '.flv', $video['thumbs']['master']); } </code></pre>
php javascript
[2, 3]
1,094,154
1,094,155
Regarding custom java library
<p>Can someone tell me how to create my own custom library in java that I could use in my Android Project. Actually I am looking to make a kind of Android 3D racing game.And also could you tell me that how could I make it. Thanks!</p>
java android
[1, 4]
2,879,129
2,879,130
Is there any way to get "global" events when working with nested iframes?
<p>My problem is I need to capture a keypress but at any given time the user can be inside of an iframe inside of an iframe inside of an iframe.</p> <p>At first, I thought I could just put the listener on document but that doesn't work if the user is inside of one of those iframes.</p> <p>Next I thought of attaching the handler to window but ie doesn't support attaching event handlers to window. I'm not even sure if that would work though or it would be the same problem as with document.</p> <p>Next, I thought I could just go through all the iframes and add individual handlers there but eventually realized that wouldn't work because the iframe doesn't have any html in the dom so there is no way to access iframes nested in it.</p> <p>One other possible solution is to go to the js of all the iframes and add this code manually but that is way too extreme.</p> <p>Any other ideas?</p>
javascript jquery
[3, 5]
1,522,674
1,522,675
Get and loop through all Select Boxes in a Table with Jquery
<p>i am new with jQuery.. i have a table with a number of boxes in it. I want to grab all the select boxes in the table and loop through them..</p> <p>I am trying to create a function that does this and it looks like this:</p> <pre><code>function calculatePercentageTotal(tableName) { var total = 0; for (i = 0; i &lt;= $("#" + tableName + ' select').length; i++) { total += parseInt($("#" + tableName + ' select')[i].val()); } return total; } </code></pre> <p>It's not working though.. any ideas? thanks!</p>
javascript jquery
[3, 5]
6,010,694
6,010,695
How can I display a rendered object inside a different class layout?
<p>Okay, so I'm using Rajawali (See: <a href="http://www.rozengain.com/blog/2011/08/23/announcing-rajawali-an-opengl-es-2-0-based-3d-framework-for-android/" rel="nofollow">http://www.rozengain.com/blog/2011/08/23/announcing-rajawali-an-opengl-es-2-0-based-3d-framework-for-android/</a>) to create a 3D sphere with an image of the Earth on it.</p> <p>I already have the sphere successfully created but now I'm starting to add UI elements around the rotating sphere. Up top, I have a header image and my end goal is to add a click event to the image and have it load up a menu on click. However, I think the reason why my onclick event isn't working is because Rajawali doesn't support touch events yet.</p> <p>So, now what I'm looking into is somehow creating a normal xml layout with the header image and then <em>loading</em> the render of the 3D sphere into the middle of the layout. Is this possible? How?</p> <p>If not, then I think I will look into using a different framework for my 3D sphere. Which one is the easiest or has a nice tutorial for a 3D sphere?</p>
java android
[1, 4]
4,299,975
4,299,976
Find control in ListView that inside a Repeater
<p>I have a ListView inside the Repeater and i like to retrieve the Id value from a tbl in repeater and assign it to a txtBox inside the ListView. My problem is i can not find controls in List view(which is inside the repeater control). (i am fairly new btw)</p> <p>I get this(Object reference not set to an instance of an obj..) Just in case i like to make it clear once again, i have a repeater, and i have both table and listView in this repeater. So i want to retrieve the ID value from a table column as each item displayed in repeater and assign this individual ID to a control inside the ListView so i can attach and display the data by their primary.ID = FK.ID. I collect the ID from repeater items by "repeaterGetSelectedID" property and asign it to a label outside of the repeater just fine but i like to assign this ID value to a textbox which is inside the listView though i can not find controls in listView. Hope i've managed to explain. Thank you!!!!</p>
c# asp.net
[0, 9]
2,296,289
2,296,290
Updating an input's value without losing cursor position
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8219639/stop-cursor-from-jumping-to-end-of-input-field-in-javascript-replace">Stop cursor from jumping to end of input field in javascript replace</a> </p> </blockquote> <p>I want to mandate that the value of a text box is lowercase, using JavaScript. I've tried the code below, but the cursor jumps to the end of the input every time you press a key. How can I avoid this?</p> <pre><code>$("#beLowerCase").keyup(function(){ $(this).val( $(this).val().toLowerCase() ); }); </code></pre>
javascript jquery
[3, 5]
2,621,165
2,621,166
Submitting forms on enter/return when using anchors as submit-input
<p>I'm using anchors to submit forms:</p> <pre><code>$("a[title=submit]").click( function(){ $(this).parents("form").submit(); }); </code></pre> <p>It works very well, however I still want the user to be able to submit the form when pressing enter or return.</p> <p>Anyone know how to do this?</p>
javascript jquery
[3, 5]
4,447,544
4,447,545
Is it OK to create multiple threadpools (ExecutorService)?
<p>I created multiple ExecutorService instances in my code, usually each UI page has one ExecutorService instance. Each ExecutorService instance will execute some http get request threads.</p> <pre><code>private ExecutorService m_threadPool = Executors.newCachedThreadPool(); </code></pre> <p>Is it OK to do that?</p> <p>The problem I met is that sometimes the http get requests got response code -1 from HttpURLConnection getResponseCode() call. I don't know whether it is caused by multiple threadpool instances.</p> <p>Thanks. </p>
java android
[1, 4]
1,112,693
1,112,694
pass javascript value to asp.net function
<p>the question says it all : i have a linkbutton to which i pass through CommandArgument a value and i need that value to be a javascript value. Thanks!</p> <p>Edit : </p> <p>here is my linkbutton tag :</p> <blockquote> <p>&lt; asp:linkbutton id="prevBut" runat="server" OnCommand="load_com" CommandArgument=to_place_javascript_string Text="previous" /></p> </blockquote> <p>and the function :</p> <blockquote> <p>public void load_com(object sender, CommandEventArgs e)</p> <pre><code>{ //get the string from e and search through the database for something } </code></pre> </blockquote> <p>i want to pass the name of a photo that is stored in a variable $.galleria.current.</p>
javascript asp.net
[3, 9]
5,760,765
5,760,766
how to delete or hide a li
<pre><code>&lt;li&gt;ff&lt;strong&gt;foobar&lt;/strong&gt;&lt;a class="icon-close" href="#."&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;ff&lt;strong&gt;foobar&lt;/strong&gt;&lt;a class="icon-close" href="#."&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;ff&lt;strong&gt;foobar&lt;/strong&gt;&lt;a class="icon-close" href="#."&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;ff&lt;strong&gt;foobar&lt;/strong&gt;&lt;a class="icon-close" href="#."&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;ff&lt;strong&gt;foobar&lt;/strong&gt;&lt;a class="icon-close" href="#."&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;ff&lt;strong&gt;foobar&lt;/strong&gt;&lt;a class="icon-close" href="#."&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;ff&lt;strong&gt;foobar&lt;/strong&gt;&lt;a class="icon-close" href="#."&gt;&lt;/a&gt;&lt;/li&gt; </code></pre> <p>On clicking the <code>a</code>, the respective <code>li</code> should be deleted.</p> <p><code>$(.close-icon).hide();</code> hides every thing.</p>
javascript jquery
[3, 5]
303,213
303,214
jQuery: Preventing list scroll?
<p>I have this scenario: Using an ajax query I fetch some data items and push them into a <code>ul</code> element as an <code>li</code> element. I use <code>$("ulele").append(new_li_item)</code>. I wrote my own custom scroll for this <code>ul</code> element using the following whenever an event is detected:</p> <pre><code>$("ulele").animate({scrollTop: '+=' + 200}, 'slow'); </code></pre> <p>The problem is when I fire that event and the list scrolls due to the <code>animate</code> function above, I want to keep it stable for at least a few seconds. When it scrolls down, elements are still being pushed so the list keeps scrolling no matter what. I am using the following way to add the li elements (which already have a <code>display:none</code> attribute):</p> <pre><code>$("#liele").delay(6000 * i).show("slow") </code></pre> <p>Is there a way I can pause this from happening without really stopping the activity of pushing elements into the ul list?</p>
javascript jquery
[3, 5]
639,307
639,308
Ajax call not working in IE7 and FF
<p>Dear All, I have one js file with a ajax call which is working fine in IE6, but not in IE7 or FF. Can somebody help?</p> <pre><code>window.onload = function() { var xmlhttp; var url = "myurl"; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { debugger; alert("Hello"); // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.open("GET", url, true); xmlhttp.send(null); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { alert(xmlhttp.responseText); } } } </code></pre> <p>In IE7 I am getting access denied error. Please help.</p> <p>EDIT: I am now trying it using jQuery, Code:</p> <pre><code>$(function() { $.ajax( { type: "GET", url: "myurl", datatype: "html", success: function(xhtml) { $("#con").html(xhtml); }, error: function() { displayMessage(......); } }); }); </code></pre> <p>Still its working in IE6 but not in Others.If its a cross domain issue, then how to solve this?</p>
javascript jquery
[3, 5]
5,392,536
5,392,537
can't access C# method using jquery
<p>I am trying to call a C# method from java script ,I am new to web development and after a bit of searching decided on using jquery to do the same,the way I try to call the method is:</p> <pre><code>$.ajax({ type: "POST", url: "Default.aspx/IncrementJ", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { alert("success!") } }); </code></pre> <p>here IncrementJ is my function name defined in C# which I want to call.here is the definition:</p> <pre><code> [WebMethod] public static void IncrementJ() { try { j++; } catch (Exception ex) { throw ex; } } </code></pre> <p>when I run my program web console throws an error "cannot locate resource incrementJ";please tell me where I am going wrong,</p> <p>Thanks .</p>
c# jquery asp.net
[0, 5, 9]
2,166,888
2,166,889
jQuery: animate to height of div
<p>I have this function:</p> <pre><code>function fixedFeeSize(i){ var num1 = $('#num' + i); if (num1.hasClass("extended")) { num1.stop(true, true).animate({height: '59px'},500); num1.removeClass("extended"); }else{ var height = 0; num1.animate({height: '360px'},500); num1.addClass("extended"); } return null; } </code></pre> <p>Which expands / contracts a div, however I am struggling to get it to expand to the height of the div as each div (there will be 10+) is going to be different heights.</p> <p>I tried <code>num1.animate({height: 'auto'},500);</code> which has not worked.</p>
javascript jquery
[3, 5]
3,785,945
3,785,946
jQuery autocomplete; want Return key to behave as Tab
<p>The following code behaves different when <strong>tab</strong> and <strong>enter</strong> keys are pressed:</p> <p>--<strong>tab</strong> replaces the text field's value with the value of the selected item and focus goes to the next input box</p> <p>--<strong>enter</strong> replaces the text field's value with the value of the selected item but the focus <em>does not</em> go to the next input box</p> <p>How do I change the behavior of <strong>enter</strong> so that the focus goes to the next input box?</p> <pre><code>$('input').autocomplete({ autoFocus: true, source: ["test","some text"], delay: 0 }); </code></pre> <p>I have tried to add the following line:</p> <pre><code>select: function(event, ui) { if (event.keyCode == 13) { trigger({ type : 'keypress', which : 9 }); } } </code></pre> <p>This doesn't work. See <a href="http://jsfiddle.net/YbPVX/4/" rel="nofollow">http://jsfiddle.net/YbPVX/4/</a></p>
javascript jquery
[3, 5]
4,613,306
4,613,307
Prevent users from re-clicking "Like" button on page refresh
<p>I want to stop a user from clicking a <em>Like</em> button multiple times. I can disable the button on the first click using jQuery, but when the page is refreshed, the user can again click the button. How do I prevent a user from re-clicking the button on page refresh?</p>
php jquery
[2, 5]
1,441,181
1,441,182
iPhone jQuery breaks after triggering the email overlay
<p>I'm developing a mobile site for iPhone using jQuery. I have a hidden div (class <code>.tile-content</code>) that holds some content. Clicking a link with <code>onclick="showContent(this)"</code> calls fadeIn like this:</p> <pre><code> function showContent(obj) { alert($(obj).html()); $(obj).next('.tile-content').fadeIn(); return false; } </code></pre> <p>Everything works great until I tap "email us" which has a mailto: link on it, triggering the iPhone's built in email overlay functionality. I then hit cancel and am returned to the site. Now, if I click a link, my <code>.tile-content</code> div won't show up. I get the proper alert on the iPhone though. After I press that once, nothing works (which I think means there was a js error?). Having a really hard time debugging on a physical iPhone. Any ideas?</p> <p><strong>Update:</strong> I enabled Safari Mobile's debug console thanks to a tip from @John Boker below. No errors show up, but I'm still having the same problem.</p>
jquery iphone
[5, 8]
785,396
785,397
How get PDU from SMS
<p>Just wondering whether is it possible to recreate PDU from SMS and how? I have looked at </p> <pre><code>@Override public void onReceive(Context context, Intent intent) { Bundle bundle = intent.getExtras(); Object[] aPDUArray = (Object[]) bundle.get("pdus"); // Here it represent as a byte array, how can i convert it to String ? } </code></pre>
java android
[1, 4]
4,198,527
4,198,528
Call C# method from another page in javascript function with jQuery
<p>In GridViewData.aspx.cs I have a method I want to call inside a javacsript function.</p> <pre><code>//This simple example method is from GridViewData.aspx.cs private int ValidateNameUpdateable() { return 22; } </code></pre> <p>I want to call this function from Javascript in default.aspx</p> <pre><code>&lt;script type="text/javascript"&gt; function validateForm() { if (ValidateNameUpdateable==22) { alert("Name is not updateable, the party already started."); return false; } //if all is good let it update UpdateInsertData() } &lt;/script&gt; </code></pre> <p>Now hears the kicker, I am mostly using jqUery as UpdateInsertData() is a jquery Call and works fine. How do I use ValidateNameUpdateable to call jQuery to return the value from the c# method. . I believe this issue is with my jQuery Call as its just posting and I need to do a $.get or something?</p> <pre><code>function ValidateNameUpdateable() { $(document).ready(function () { $.post("GridViewData.aspx") }); } </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
5,411,891
5,411,892
Iframe in the jquery UI dialog
<p>I have an iframe in the jquery UI dialog , setting its src at doument.ready event :</p> <pre><code> $(document).ready(function() { $("#iframe").attr("src", whatever); $("#button").click(function() { $("#dialog").dialog(); }); }); &lt;div id="dialog"&gt; &lt;iframe src="" id="iframe"&gt;&lt;/iframe&gt; &lt;div&gt; </code></pre> <p>Everything is going fine, when i <code>click over the button dialog open</code> but <code>the problem</code> is that it <code>loads iframe content everytime when dialog open</code>.I <code>want to stop</code> this behaviour and <code>load the contents only once at document.ready event</code>.How can i do this?</p>
javascript jquery
[3, 5]
2,425,050
2,425,051
How to apply selected color to selected cell
<p>Sir, There is one table with different colors. Under that second table suppose with 3 columns,3rows.</p> <p>After clicking on the color i will click any cell in the below table.that color have to apply for that particular cell. It is like paint bucket. Can u tell me how to do this?</p>
php javascript
[2, 3]
3,057,246
3,057,247
How do I use two .siblings with the same input type?
<p>I want to get "The walking dead" also but it only gets the first hidden. Can i put a class on .this or how should I do?</p> <pre><code>$(".articel input[type='button']").click(function(){ var price = $(this).siblings("input[type='hidden']").attr("value"); var quantity = $(this).siblings("input[type='number']").attr("value"); var name = $(this).siblings("input[type='hidden']").attr("value"); var ul = document.getElementById("buylist"); var prod = name + " x " + quantity + " " + price + "$"; var el = document.createElement("li"); el.innerHTML = prod; ul.appendChild(el); &lt;form class="articel"&gt; Quantity: &lt;input type="number" style="width:25px;"&gt;&lt;br&gt; Add to cart: &lt;input type="button" class="btn"&gt; &lt;input type="hidden" value="30"&gt; &lt;input type="hidden" value="The walking dead"&gt; &lt;/form&gt; </code></pre> <p>Thanks for helping.</p>
javascript jquery
[3, 5]
1,104,515
1,104,516
passing parameters in url to another page
<p>I am going to create two pages.</p> <p>The first page will be www.rentzamm.com?adv=1256&amp;loc=768 ...On this page I am going to have a link which takes you to www.rentzamm.com/result.asp ..... Now when i press the link from page 1 I want the link of page 2 to be like this: www.rentzamm.com/result.asp?adv=1256&amp;loc=768 ... is this possible please?</p>
javascript jquery
[3, 5]
2,386,251
2,386,252
Value of object in UI variable only
<p>Pass data object value from class to UI, want to pass it in array type variable only so that i can print respective values easily? ways to pass these values to UI?</p>
java php javascript
[1, 2, 3]
3,119,737
3,119,738
How can i convert a time (12:30 am) into timestamp using javascript?
<p>Can anyone tell me how to that? I would like to compare 2 times and find out which one is greater? like 12:30 pm and 5:30 pm</p>
javascript jquery
[3, 5]
3,628,139
3,628,140
Retrieving selected text with offset values
<p>I want to annotate a text and store the annotated text in database .what am doing is, storing the offset values and selected text in the database.Is there is a possible way to retrieving selection using offset values.</p>
php javascript
[2, 3]
3,875,601
3,875,602
After .load() Reset Textbox with User Entered Value using JavaScript and jQuery
<p>My function below calls a partial view after a user enters a filter-by string into the text box <code>'#DocId'</code>. When the user is done typing, the partial view is displayed with filtered data. Since my textbox needs to be in the partial view, when user is done entering a filter-by string and is shown the filtered data, the textbox is reset and the user entered data is lost. How can I set the value of the textbox back to the user entered string after the partial view is displayed?</p> <p>I'm pretty sure I need to use <code>.val()</code> but I can't seem to get this to work.</p> <pre><code>$(function() { $('#DocId').live('keyup', function() { clearTimeout($.data(this, 'timer')); var val = $(this).val(); var wait = setTimeout(function() { $('#tableContent').load('/CurReport/TableResults', { filter: val }, 500) }, 500); $(this).data('timer', wait); }); }); </code></pre> <p>Thank you,</p> <p>Aaron</p>
javascript jquery
[3, 5]
1,562,667
1,562,668
ScrollView in android
<p>I have a TableLayout, in which rows are dynamically created, thus it may cross the limited screen size. To avoid this I am trying to add a scroll view after creating the table layout as:</p> <pre><code>TableLayout tl = (TableLayout) findViewById(R.id.tableLayout1); ScrollView sv = new ScrollView(this); tl.addView(sv); for (i = 0; i &lt; count; i++) { TableRow tr = new TableRow(this); . . . . //finally iam adding this table row to layout. tl.addView(tr, new TableLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); submit.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent myIntent = new Intent(getApplicationContext(), SmsActivity.class); // setMessageBody((String) tvf.getContentDescription()); // submit.setEnabled(false); String messageText = (String) valueTV.getText(); String dateText = (String) labelTV.getText(); myIntent.putExtra("messageText",dateText+"\n"+message); startActivity(myIntent); }}); } </code></pre> <p>However the application is getting force closed if the number of rows increases more than the size of display.</p> <p>My log cat shows the error as </p> <pre><code>06-28 14:41:49.533: ERROR/AndroidRuntime(1256): Caused by: java.lang.StringIndexOutOfBoundsException </code></pre> <p>What is the problem and how can I fix it?</p>
java android
[1, 4]
3,868,619
3,868,620
ASP Button Edit in GridView ASP.NET C#
<p>I'm trying to make an Edit button in gridview. So far I can only add a delete asp:button but what about edit button? Is there any way I could modify the CommandField to look like asp:button instead of linkbutton?</p> <p>Any help would be much appreciated. Thanks in advance ;) </p>
c# asp.net
[0, 9]
2,653,525
2,653,526
How to change button text color programmically on press?
<p>I create button like this:</p> <pre><code>Button button = new Button(this); button.setText("2012"); button.setBackgroundColor(Color.TRANSPARENT); button.setOnClickListener(mCorkyListener); layout.addView(dateButton); </code></pre> <p>On click listiner i have this method. Here i want to change button text color. Bu View don't have this method</p> <pre><code> private OnClickListener mCorkyListener = new OnClickListener() { public void onClick(View v) { // do something when the button is clicked //v.setBackgroundColor(Color.RED); //so how to change pressed button text color ? //v.setTextColor(colors); } }; </code></pre> <p>There wouldn't be just one button. There would be many of those and i need to chnage text color when button pressed.</p>
java android
[1, 4]
5,330,797
5,330,798
Accessing data from server through php in iphone
<p>I am using this code for accessing data from server,</p> <pre><code>NSString *post = [[NSString alloc] initWithFormat:@"Email=%@",GEmail]; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]]; NSURL *url = [NSURL URLWithString:@"http://smads.in/day.php"]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; [theRequest setHTTPMethod:@"POST"]; [theRequest setValue:postLength forHTTPHeaderField:@"Content-Length"]; [theRequest setHTTPBody:postData]; NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if( theConnection ) { webData = [[NSMutableData data] retain]; } else { } </code></pre> <p>it fetch data slightly late so problem is that-- i have a code which check fetched data from server--</p> <pre><code>If(flag==1) NSlog(@"YES"); else NSlog(@"NO"); </code></pre> <p>when i click first time then it print NO when i again click then it display yes.</p> <p>how i check condition in one click?</p> <p>suggest me if any idea.....</p> <p>Thanks,</p> <p>Arun</p>
php iphone
[2, 8]
3,241,462
3,241,463
Select Columns runtime in LINQ LIST<>
<p>I have <code>List&lt;Employee&gt; listEmployees</code></p> <p>I want to select some dynamic columns which are not known at compile time, like:</p> <pre><code> var result = from l listEmployees select "" </code></pre> <p>I tried <code>listEmployees.select("Name");</code></p> <p>But it throws an error saying :</p> <blockquote> <p>'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. </p> </blockquote> <p>How can I select columns runtime?</p>
c# asp.net
[0, 9]
3,922,563
3,922,564
Partial Text Replace with Script
<p>Trying to replace Your Price with Discount price on this <a href="http://bit.ly/unxGy0" rel="nofollow">page</a>, what am I doing wrong?</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready ( function() { $("td:contains('Your Price:')").text("Discount Price:"); } ); &lt;/script&gt; </code></pre> <p>Thanks!</p>
javascript asp.net
[3, 9]
515,070
515,071
Don't understand the constructor of my View
<p>My code is working and so, but I don't understand one thing. I've started game programming and now works my whole SurfaceView and so on. I have draw a background so it all works.</p> <p>When I created this I followed a tutorial, so know I'm commenting on my own language. :) When I now started to comment some things; I can't get rid of this, can someone tell me why my constructor for my view has the Context parameter and AttributeSet paramater? What makes it necessary to have these and why do I need to set the localContext value to my GameView context?</p> <p><strong>Game</strong></p> <pre><code>public class Game extends Activity{ @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(new GameView(this, null)); } </code></pre> <p>}</p> <p><strong>GameView</strong></p> <pre><code> public GameView(Context localContext, AttributeSet attrSet){ super(localContext, attrSet); context=localContext; InitView(); } </code></pre> <p>The InitView(); just initialize every objects and variables I created; if this stuff is needed in order to explain the constructor-thing to me; I will post it.</p> <p>Thanks!</p>
java android
[1, 4]
5,842,985
5,842,986
How to use json data that 'arrives' X seconds later?
<p>I'm filling out a list with a json. However that json (php file) gives me the result X seconds later (unknown time). </p> <p>External file - Getting the json data:</p> <pre><code>$(function(){ // can't modify this file $.getJSON('json.php', function(data) { items = []; $.each(data, function(key, val) { items.push('&lt;li id="' + key + '"&gt;' + val + '&lt;/li&gt;'); }); }); }); </code></pre> <p>Inline code - Output:</p> <pre><code>&lt;script&gt; $(function(){ $('&lt;ul/&gt;', { 'class': 'my-new-list', html: items.join('') }).appendTo('#result'); }); &lt;/script&gt; </code></pre> <p>Right now I see nothing in <code>#result</code> because both codes are being loaded at the same time so the output can't find the 'items'. </p> <p>How could I modify the <strong>Inline code</strong> in order to force it to wait until the external file gives me the json data ? Maybe an observer ?</p> <p>EDIT: It looks like I didn't explain it well enough. I'm sorry for my poor english. I'm also a Js/Jquery newbie.</p> <p>EDIT 2: If we have no delay getting the json data everything works, however it depends on some external devices connected through serial communications and sometimes it takes 2,3 or 5 seconds to get the json.</p>
javascript jquery
[3, 5]
3,599,560
3,599,561
using an asp.net literal inside the <title> element
<p>This is such a simple scenario that I can't see what can possibly be going wrong. I'm using asp.net 4.0 (haven't tried older versions)</p> <pre><code>&lt;title&gt;Welcome to Page: &lt;asp:Literal ID="Literal1" runat="server"&gt; &lt;/asp:Literal&gt;&lt;/title&gt; </code></pre> <p>When the page is rendered, the title comes out as just the contents of the literal control without the "welcome to page" text in it. If you don't believe me, try it for yourself</p> <p>Can anyone explain?</p> <p>Andy</p>
c# asp.net
[0, 9]
33,116
33,117
Getting NewLine character in FreeTextBox control in Asp.net
<p>I am using <a href="http://freetextbox.com/" rel="nofollow">FreeTextBox control</a></p> <p>in asp.net.When I am getting its HtmlStrippedText in my code I am getting the String without HTML tags.Now how can I get the new line character from this String i.e. I want to Replace All the NewLine characters with Special Symbol "@".</p>
c# asp.net
[0, 9]
5,368,839
5,368,840
Installing .net framework v4.30319
<p>I want to install .net framework v4.30319 for web service. When run this command in cmd: </p> <pre><code>C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.reggis.exe -i </code></pre> <p>it creates administrative rights issues. But I am already logged in with an administrator account. How can I resolve the administrative issues?</p>
c# asp.net
[0, 9]
2,409,451
2,409,452
Adding an input name upon creation of new table row
<p>I have an order form I had put together for a client, you can view it <a href="http://www.tdidesign.com/designerorderform.php" rel="nofollow">here</a>.</p> <p>As you can see it creates a new row with 5 input fields (per row). Here's my problem, I have this form outputting the form in html format to the clients email for office use. I need to add a "unique name" for each input in the newly created row in order to pass that to the processing and out to the email.</p> <p><a href="http://www.tdidesign.com/js/jquery.tables.js" rel="nofollow">Here is the JS file for adding rows</a></p> <p>I know this has to be triggered by the $addRowBtn but I have been at this for awhile now and everything I have tried has just broken the form.</p> <p>I've tried this example but to no avail:</p> <pre><code>thisRow.find("input.ClassName").attr("name","newName" + num); num++;</code></pre> <p>I will buy the first person that helps with this a cup of coffee or something! It's bugging the ever living crap out of me!!</p>
javascript jquery
[3, 5]
2,469,014
2,469,015
Dynamically populating and setting value in dropdownlist in ASP.Net
<p>I have a form where I have 4 dropdowns Country, State, District and City. Country is populated on form load and rest are populated on selected index changed event. The sequence is On Country's selected index changed States are populated. On State-> Districts populated and on Districts -> Cities are populated. </p> <p>For saving it worked fine but when i was updating value, it shows null reference error. On debugging I got, the dropdowns are not populated, whereas I was trying set values. Below is my code.</p> <pre><code>using (var manager = new LocationManager()) { var dt = manager.GetLocationById(i); if (dt.Rows.Count == 1) { Countries.SelectedValue = Countries.Items.FindByText(dt.Rows[0]["Country"].ToString()).Value; BindStates(Convert.ToInt32(Countries.SelectedItem.Value)); States.SelectedValue = States.Items.FindByText(dt.Rows[0]["State"].ToString()).Value; BindDistricts(Convert.ToInt32(States.SelectedItem.Value)); Districts.SelectedValue = Districts.Items.FindByText(dt.Rows[0]["District"].ToString()).Value; BindCities(Convert.ToInt32(Districts.SelectedItem.Value)); Cities.SelectedValue = Cities.Items.FindByText(dt.Rows[0]["City"].ToString()).Value; Pincode.Text = dt.Rows[0]["Pincode"].ToString(); ViewState["Id"] = dt.Rows[0]["LocationId"].ToString(); } } </code></pre> <p>I am getting error: {"Object reference not set to an instance of an object."} at method </p> <blockquote> <p>BindStates(Convert.ToInt32(Countries.SelectedItem.Value));</p> </blockquote>
c# asp.net
[0, 9]
5,577,043
5,577,044
Can jQuery be used server side?
<p>I know that you can use JavaScript server side with node.js, but can we use jQuery for backend as well? Or will I just have to learn CoffeeScript instead of jQuery?</p>
javascript jquery
[3, 5]
1,466,781
1,466,782
read Data from text files
<p>I'm trying to read a text files and insert the data from these text files into a URL; but i have this error "java.lang.illegalargumentexception contains a path separator file" </p> <p>this is the read method that im using </p> <p>></p> <pre><code>public String ReadFile (String Path){ String res = null; try { String filePath = android.os.Environment.getExternalStorageDirectory().getPath() + "/" + Path; File file = new File(filePath); if(file.exists()){ InputStream in = openFileInput(filePath); if (in != null) { // prepare the file for reading InputStreamReader input = new InputStreamReader(in); BufferedReader buffreader = new BufferedReader(input); res = ""; String line; while (( line = buffreader.readLine()) != null) { res += line; } in.close(); }else{ } }else{ Toast.makeText(getApplicationContext(), "The File" + Path + " not Found" ,Toast.LENGTH_SHORT).show(); } } catch(Exception e){ Toast.makeText(getApplicationContext(),e.toString() + e.getMessage(),Toast.LENGTH_SHORT).show(); } return res; } &gt; String sendername = ReadFile ("SenderName.txt"); String AccountName = ReadFile ("AccountName.txt"); String AccountPassword = ReadFile ("AccountPassword.txt"); String MsgText = ReadFile ("MsgText.txt"); </code></pre> <p>Thanks,</p>
java android
[1, 4]
942,770
942,771
PHP code of javascript
<p>How do I write this HTML code in PHP?</p> <pre><code>&lt;input class="input" name="email" value="Email:" id="email" type="text" onBlur="if(this.value=='') this.value='Email:'" onFocus="if(this.value =='Email:' ) this.value=''" &gt; </code></pre>
php javascript
[2, 3]
323,057
323,058
Avoid displaying javascript confirmation when no checkbox is set
<p>Like the title says, I have a problem with checkbox validation. So, I have this line in my php file which displays users.</p> <pre><code>&lt;a href='#' onclick='if(confirm("Are you sure?"))checkbox.submit()' class='bt_red'&gt;&lt;span class='bt_red_lft'&gt;&lt;/span&gt;&lt;strong&gt;Delete items&lt;/strong&gt;&lt;span class='bt_red_r'&gt;&lt;/span&gt;&lt;/a&gt; </code></pre> <p>in my delete_items.php file I wrote the following :</p> <pre><code>$checkbox = $_REQUEST['checkbox']; if(!isset($checkbox)) { //diplay an error message :"No user selected" } else { if(isset($checkbox)) { // deleting users script } } </code></pre> <p>In the 2 cases, when clicking on the "delete items" , I get the javascript confirmation message, which I don't want to display when no checkbox is set (the if(!isset($checkbox)) statement).</p> <p>thank you for help.</p>
php javascript
[2, 3]
3,313,383
3,313,384
jQuery autocomplete focus one more time after hide
<p>Does anybody know why after clicking outside the search field and hiding autocomplete results a focus activate one more time? See please at <a href="http://layot.prestatrend.com/" rel="nofollow">http://layot.prestatrend.com/</a> Type for example just 3 letters at search field 'ipo'. Thanks for any reply!</p>
javascript jquery
[3, 5]
5,990,208
5,990,209
jQuery scrolling DIV: stop scrolling when DIV reaches footer
<p>I have a <code>#sidebar</code> (which starts below my <code>#header</code> div) and a <code>#footer</code> (around 120px off the bottom of the page).</p> <p>I'm trying to make the sidebar scroll with the content of the page. The code below does this semi-successfully:</p> <pre><code>/* profile sidebar */ #sidebar&gt;div{ width: 300px; margin-top: 10px; } #sidebar.fixed&gt;div{position:fixed;top:0;} #sidebar.fixed_bottom&gt;div{position:fixed;bottom:172px;} jQuery(function ($) { $.fn.scrollBottom = function() { return $(document).height() - this.scrollTop() - this.height(); }; var el = $('#sidebar'), pos = el.position().top; $(window).scroll(function() { if ($(this).scrollTop() &gt;= pos) { if ( $(this).scrollBottom() &lt;= 172 ) { el.removeClass('fixed'); el.addClass('fixed_bottom'); } else { el.removeClass('fixed_bottom'); el.addClass('fixed'); } } else { el.removeClass('fixed'); } }); }); </code></pre> <p>The problem is, on smaller resolutions, this makes the sidebar "jump" once you reach a certain position on the page. It stops it from overlapping the footer (which is the problem if you remove the <code>fixed_bottom</code> class) but doesn't look good.</p> <p>What I'd like to do is this: user scrolls to the bottom of the page, the sidebar scrolls along with the content until it reaches say 20px above the top of my footer, at which point it stays there until the user scrolls back up.</p> <p>Thanks in advance,</p>
javascript jquery
[3, 5]
5,889,633
5,889,634
jquery remove all child elements and leave text
<p>Whats the best way to remove all child elements from a div but leave any text that is directly inside the div in jquery.</p> <p>I have tried .childre().remove() but this is adding loads of whitespace in firefox and opera. Works fine in ie though.</p>
javascript jquery
[3, 5]
5,682,149
5,682,150
JQuery Custom Image From Checkbox to Radio
<p>I am using the following code to make a custom checkbox with my own images and it works but it's using a Checkbox and I need to use Radio buttons.</p> <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $("#moreinfo").change(function() { if(this.checked) { $(this).prev().attr("src", "checkbox_unchecked.gif"); } else { $(this).prev().attr("src", "checkbox_checked.gif"); } }); }); &lt;/script&gt; </code></pre> <p>Next...here's the HTML:</p> <pre><code>&lt;label for="moreinfo"&gt; &lt;img src="checkbox_unchecked.gif"/&gt; &lt;input name="moreinfo" type="checkbox" id="moreinfo" style="display:none"&gt; &lt;/label&gt; </code></pre> <p>If it a question of changing from checkbox to radio type or does the jquery need changing too?</p> <p>How do I go about this?</p>
javascript jquery
[3, 5]
3,985,067
3,985,068
Highlight selected list item only on long click?
<p>I'm using this to make a list item visible selected:</p> <pre><code>&lt;item android:state_activated="true" android:drawable="@android:color/holo_blue_light" /&gt; </code></pre> <p>But I want the item only to be highlighted if a longclick is performed (so to say: only during the context menu bar is displayed above). And on a single click I do not want it to be highlighted, even though performing an action on single click.</p> <p>How can I disable the activated state only on longclick?</p>
java android
[1, 4]
3,142,617
3,142,618
use $(this) in ajax callback jquery
<p>i'm doing a <code>jQuery.post</code> to a php file, and the file return's me a value.</p> <p>the question is: why the <code>$(this)</code> dosent work in the callback function ? any alert passing something to show, using <code>$(this)</code>, return's me <code>null</code></p> <pre><code>$(".class").live("focusout", function(){ jQuery.post("phpfile.php", { someValue: someValue }, function(data) { // why the $(this) dosent work in the callback ? } ) }); </code></pre>
javascript jquery
[3, 5]
358,239
358,240
if width == 200px run function
<p>Here is a <a href="http://jsfiddle.net/hSqYG/" rel="nofollow">jsFiddle showing the problem</a></p> <p>I'm not sure why this doesn't work:</p> <pre><code>if ($('#menu').width() == '200px') { alert("what"); } </code></pre> <p>I want an alert to appear when the animation is completed. So I assumed that I could say that since when the animation is done the element has a width of 200px, it would show the alert.</p>
javascript jquery
[3, 5]
863,943
863,944
JavaScript Date in this format: "Wednesday, March 03, 2010 05:44:15 PM"
<p>I want to display date like this in my website "Wednesday, March 03, 2010 05:44:15 PM".</p> <p>If I use JavaScript it will take lengthy code. Is there any other way to do this?</p>
javascript jquery
[3, 5]
3,578,627
3,578,628
Best practices in realization of inner lists in android
<p>I'm newbie in android developing so I'd like to ask for advice about solving the next problem.</p> <p>I have 2 SQlite tables: <code>cards</code> and <code>meanings</code>. Each card has one or several meanings. My android application should show a list of the cards with the realted meanings. I should realise next operations:</p> <ul> <li>add a new card with a meaning</li> <li>add a meaning for an existing card</li> <li>read card with meanings, update, delete</li> </ul> <p>As far as I understand best way of realisation this is to make 2 content providers for the cards and for the meanings. Then I'd like to construct a class which would encapsulate cards' functionality and the put the cards into some kind of adapter. And then bind the adapter to some kind of list view.</p> <p>I'm not sure that this way is the most optimal, that's why any advices about better ways of doing this is highly appreciated.</p>
java android
[1, 4]
761,275
761,276
Add html elements dynamically to a inner html of an li element
<pre><code> function showHideMinMax(typeid ,value){ // extract the index number from typeid var indexNr = typeid.match(/\d+/); if(value == "blah"){ $("input#A"+indexNr).hide(); $("input#B"+indexNr).hide(); $("label[for=C"+indexNr+"]").hide(); $("label[for=D"+indexNr+"]").hide(); }else{ $("input#A"+indexNr).show(); $("input#B"+indexNr).show(); $("label[for=C"+indexNr+"]").show(); $("label[for=D"+indexNr+"]").show(); } } </code></pre> <p>I have a javascript function like above. So what I want is that in the else part is that if the html elements mentioned above in the else part dosen't exits then create them and append to the html portion inside the li element. How can I achieve this.?</p> <p>The li element looks like this and the above elements are inside this html li element</p> <pre><code> &lt;li class="css" id="demo"+somenumber "&gt; </code></pre>
javascript jquery
[3, 5]
581,412
581,413
Strip "http://" from pasted text into textbox
<p>I'm a total newbie when it comes to Javascript/jQuery so hopefully you can help me.</p> <p>I have a textbox where most people are gonna paste links into. Is there a nice way for the textbox to detect that a link has been pasted (starts with <code>http://</code>) and then remove the protocol dynamically in the textbox without having to push a button or so afterwards?</p>
javascript jquery
[3, 5]
1,724,065
1,724,066
Check whether connection to the database is possible or not?
<p>I need to connect to the sql server database from my c# code. sometimes because of some error( i dont know what it is) i cannot open connection that is conn.open() throws exception so i need to check whether i can connect to the database before i am opening connection.</p> <p>Thanks for helping me.</p>
c# asp.net
[0, 9]
4,427,769
4,427,770
Execute complete function only once in jQuery animation?
<p>I'm trying to animate the font size of some text:</p> <pre><code>$("p").delay(500).animate({ "font-size": "+=50" }, 1000, function() { alert("Done"); })​; </code></pre> <p><a href="http://jsfiddle.net/DerekL/e6FFt/" rel="nofollow">Here's a demo.</a></p> <p>I want to do something after animating the <code>&lt;p&gt;</code>s, which in the example is <code>alert</code>, but it surprisingly runs it for each <code>&lt;p&gt;</code>, and that's not what I want. Is there a possible way to make it just run once or is it not possible?</p>
javascript jquery
[3, 5]
4,011,039
4,011,040
Swtich between text with each click
<pre><code>$("#mute").click(function(){ $("#audioplayer")[0].muted = $("#audioplayer")[0].muted; $("#message").text("Volume muted"); }) </code></pre> <p>What I need to achieve is when the users clicks again the button "mute", they will receive another message with "Volume UnMuted", instead of muted, if he clicks it again, switch back to mute, and so on.</p>
javascript jquery
[3, 5]
5,325,857
5,325,858
Javascript plugin to manage placeholder
<p>Look at the Twitter sign up page at <a href="https://twitter.com/signup" rel="nofollow">https://twitter.com/signup</a></p> <p>Even when you click on first input field "Full name" placeholder stays there until I start typing something. That is awesome.</p> <p>Does anyone know of a good jQuery plugin that comes close to that?</p>
javascript jquery
[3, 5]
2,459,482
2,459,483
cursor not stopping until button click completes in window.onbeforeunload?
<p>I have below javascript code for window.onbeforeunload. I am calling code behind button click method when pressed browser back button. </p> <p>Now the problem is cursor is not stopping until <code>$("#buttonclientid").click()</code> completes. Just calling the method and moving to next statement. How to hold or stop cursor until <code>$("#buttonclientid").click()</code> complete and then move to next step?</p> <pre><code>var form_has_been_modified = 0; $(function () { $("input").keyup(function () { form_has_been_modified = 1; }) window.onbeforeunload = function (e) { if (!form_has_been_modified) { return; } doYouWantTo(); } }); function doYouWantTo(){ doIt=confirm('Do you want to save the data before leave the page?'); if (doIt) { var returnbutton; //cursor should stop here until click function completes. returnbutton = $("#buttonclientid").click(); } else{ } } </code></pre>
javascript jquery asp.net
[3, 5, 9]
3,112,555
3,112,556
Javascript and JQuery conflict
<p>I'm not very expert in using javascript and jquery but I'm working with them for a client.<br> I have encountered a problem using two script: the first one makes a top panel sliding, the second is in a form. This one is used in order to hide or show a particular field basing on the drop down list choice. </p> <p>I've found that if I disable the first script (the panel), the second script is working fine and vice versa. I tried usign JQuery noConflict() in the head of the page but nothing happened. </p> <p>Here the code of the first script (sliding panel): </p> <pre><code>$(document).ready(function () { // Lets make the top panel toggle based on the click of the show/hide link $("#sub-panel").click(function () { // Toggle the bar up $("#top-panel").slideToggle(); // Settings var el = $("#shText"); // Lets us know whats inside the element var state = $("#shText").html(); // Change the state state = (state == 'Nascondi' ? '&lt;span id="shText"&gt;Entra&lt;/span&gt;' : '&lt;span id="shText"&gt;Nascondi&lt;/span&gt;'); // Finally change whats insdide the element ID el.replaceWith(state); }); // end sub panel click function }); // end on DOM </code></pre> <p>Here the JS code for the form (hide/show field): </p> <pre><code>$document.addEvent('domready', function () { $('motivo_contatto').addEvent('change', function () { if ($('motivo_contatto').value == 'Invia CV') { $('upload_file').style.visibility = 'visible'; } else { $('upload_file').style.visibility = 'hidden'; } }); $('upload_file').style.visibility = 'hidden'; }); }); </code></pre> <p>Can anyone help me ? Thank you and have a nice day! </p>
javascript jquery
[3, 5]
3,159,972
3,159,973
Jquery - is it possible to bind css hover/focus behaviours to keydown?
<p>I hope I can be succinct with my question.</p> <p>Lets say I have some css defined.</p> <pre><code>.someCSS-name:hover &gt; .list-item, .someCSS-name:active &gt; .list-item, .someCSS-name:focus &gt; .list-item { display:block; } </code></pre> <p>Now, in my jquery code how can I create or possible bind a tab press with that css above. Sorta have the tab keypress inherit that css behaviour?</p> <p>Perhaps I am overthinking it here.</p> <pre><code>&lt;li class="someCSS-name" id="linkoneli"&gt; &lt;a href="someURL" id="linkonenav"&gt;Link One&lt;/a&gt; &lt;div class="list-item"&gt;show this content&lt;/div&gt; &lt;/li&gt; </code></pre> <p>That is a snippet, basically a user tabs on that link - and I have a popup that shows.. but instead of explicitly eventHandling and poping it etc.. I was hoping that i could use my CSS to somehow become binded to my tab/keypress.. possible? So a tab would be the same as 'hover' etc..</p>
javascript jquery
[3, 5]
4,601,586
4,601,587
Changing img src does not display image
<p>Edit: Okay, the code is fine. There was some other code that was supposed to set other attributes somewhere else and I fell prey to the "copy/paste forgot to change the ID name" disease. Thanks for everyone's input. Sorry for being a bonehead.</p> <p>I have a situation where I am using jquery to dynamically change the img src attribute when the user click an image. Basically switching back and forth between a Register and an UnRegister button. When I click on the register button it correctly switches to the UnRegister image. However, it will never switch back to the Register image if I click on it again. My code:</p> <pre><code>function unRegister() { $('#reg').attr("src","/images/btnRegister.png"); $('#reg').attr("onClick","register()"); } function register() { $('#reg').attr("src","/images/btnUnregister.png"); $('#reg').attr("onClick","unRegister()"); } </code></pre> <p>Seems easy enough. I've verified that both images are spelled correctly and are in the /images directory. I need the two routines because once this little problem is solved I will be doing many different things based on what operation is happening. I've verified (via the handy alert() call that the routines are being called, just no image switch.</p>
javascript jquery
[3, 5]
2,922,668
2,922,669
remove <a href> from a draggable when being dragged - jquery
<p>I have this site which is a grid of draggable links. When dragged a drop down appears where the user can drag to trash the draggable. </p> <p>Problem is that when they drop it on the droppble, the link opens up! Which is not supposed to be happening. I've tried adding</p> <pre><code>ui.draggable.find('a').removeAttr('href') </code></pre> <p>to my handleDropEvent function, but it didn't help.</p> <p>Any javascript geniuses care to take a look?</p> <p><strong>EDIT</strong> I tried also adding :</p> <pre><code>ui.draggable.find('a').click(function(e) { e.preventDefault(); </code></pre> <p>to the following like so:</p> <pre><code>$('.draggable').draggable({ start: function( event, ui ) {$('#dropdownAddTile').slideDown();ui.draggable.find('a').click(function(e) { e.preventDefault(); });}, stop: function() {$('#dropdownAddTile').slideUp();}, containment: '#container', snap:'.droppable', snapMode:'inner', revert:'invalid',snapTolerance: 32}); </code></pre> <p><strong>ANOTHER EDIT</strong></p> <p>I should point out (just figured out) that I have the draggable class applied to an href like this :</p> <pre><code>&lt;a href class="draggable"&gt; </code></pre> <p>So solutions so far have caused the problem where we remove the link and it stops the draggable from being draggable! Is there another way?</p>
javascript jquery
[3, 5]
1,341,445
1,341,446
javascript and asp.net using json
<p>I've question about asp.net and javascript post and get, I know how to get the value from drop down list in asp.net connected to database, but how to send thing to asp.net and asp.net send it back ...</p> <pre><code>&lt;div id="map" style="width: 500px; height: 500px"&gt; &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:RFIDConnectionString %&gt;" SelectCommand="SELECT neighborhood_name FROM [Neighborhood]"&gt;&lt;/asp:SqlDataSource&gt; &lt;asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="&lt;%$ ConnectionStrings:RFIDConnectionString %&gt;" SelectCommand="SELECT street_name FROM [Street]"&gt;&lt;/asp:SqlDataSource&gt; &lt;asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="&lt;%$ ConnectionStrings:RFIDConnectionString %&gt;" SelectCommand="select * from Street,neighborhood where Street_status='high' and street.neighborhood_id=neighborhood.neighborhood_id"&gt;&lt;/asp:SqlDataSource&gt; &lt;asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="&lt;%$ ConnectionStrings:RFIDConnectionString %&gt;" SelectCommand="SELECT neighborhood_name FROM [Neighborhood]"&gt;&lt;/asp:SqlDataSource&gt; &lt;/div&gt; </code></pre>
javascript asp.net
[3, 9]
5,768,000
5,768,001
How to get HTML from a current request, in a postback
<p>I have a report that I generate with HTML. </p> <p>I'd like to get the HTML output of the page, and be able to send it via email. I'm having problem with session, because the report redirect me to the login page because when I create a new WebRequest, it doesn't use the information of the current session.</p> <p>Is there a way to get the HTML of the report without having to code a work-around for the security ?</p> <p>Thank you</p>
c# asp.net
[0, 9]
3,129,223
3,129,224
Convert InputStreamReader to InputStream
<p>How can I convert <code>InputStreamReader</code> to <code>InputStream</code>? I have an <code>InputStream</code> which contains some string and byte data and I want to parse it. So I wrap my <code>InputStream</code> to <code>BufferedReader</code>. Then I read 3 lines from it. After that I want to get the rest of data(bytes) as is. But if I try to get it nothing happens. Code snippet:</p> <pre><code>BufferedReader br = new BufferedReader(new InputStreamReader(is,"UTF-8")); String endOfData = br.readLine(); String contentDisposition = br.readLine(); String contentType = br.readLine(); file = new File(filename); if(file.exists()) file.delete(); file.createNewFile(); FileOutputStream fos = new FileOutputStream(file); byte[] data = new byte[8192]; int len = 0; while (-1 != (len = is.read(data)) ) { fos.write(data, 0, len); Log.e("len", len+""); } fos.flush(); fos.close(); is.close(); </code></pre> <p>The file is empty. If I don't wrap <code>InputStream</code> it works fine, but I need to read 3 lines and remove it. Thanks. </p>
java android
[1, 4]
5,427,468
5,427,469
From Java to C++ or C#
<p>I am having a technical interview in a week where I expect questions in C++ or C#. I have strong knowledge and experience in Java. Which one (C++ or C#) would be easy to jump and be prepared in a week for simple questions like binary tree, linked list etc? I have never worked with any of them. So syntax similariness, concept etc are important for me. I need start with one of them asap.</p> <p>Thanks for your comments.</p>
c# java c++
[0, 1, 6]
4,507,245
4,507,246
Unsaved changes warning popup
<p>I'm trying to implement a "Unsaved changes" warning in my web application but I'm struggling to get this working properly. I know about the existence of onbeforeunload event in javascript, but I was requested to use a custom div with some fancy formatting as a modal popup to prompt the user about those unsaved changes.</p> <p>What I've got so far is this:</p> <p>Basically what it does is bind a function that would check if the page is dirty and prompt the user with the popup before clicking any link or button, etc that could cause a postback. One of the problems I'm having right now is that all the cancelled events seem to be running when I press continue, instead of just the last one.</p> <p>I know it is not the best solution, but it is the only thing that came to my mind. Better ideas are welcome :)</p> <p>jQuery function to bind an event before all the others:</p> <pre><code>$.fn.bindFirst = function(name, fn) { this.bind(name, fn); var handlers = this.data('events')[name.split('.')[0]]; if (handlers.length) { var handler = handlers.pop(); handlers.splice(0, 0, handler); } }; function hideSaveWarning() { $("#divSaveWarning").hide(); } </code></pre> <p>This will set the continue button to do the cancelled action</p> <pre><code>function showSaveWarning(e) { $("#divSaveWarning").show(); $("[id$='_btnContinue']").click(function() { e.currentTarget.click(); }); } function onClickContinueWithoutSaving() { hideSaveWarning(); setDirtyContent(false); } function SetSavePrompt() { setDirtyContent(false); $(":input, :radio, :button, a").not("[id$='_btnSave']").bindFirst('click', function(e) { if (isPageDirty) { showSaveWarning(e); return false; } }); } </code></pre> <p>Thanks. Regards.</p>
javascript jquery asp.net
[3, 5, 9]
5,890,651
5,890,652
how to get value into a php variable after setting value of textfield with javascript within same page
<pre><code> &lt;form name="demo" method="GET"&gt; &lt;input name="test" value=""&gt; &lt;/form&gt; &lt;script&gt; document.demo.test.value=2; &lt;/script&gt; &lt;? $s=$_GET[test]; echo $s; ?&gt; </code></pre>
php javascript
[2, 3]
5,714,231
5,714,232
Way to include a .js inside a .js?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/950087/include-javascript-file-inside-javascript-file">Include javascript file inside javascript file?</a> </p> </blockquote> <p>Is this possible? Including a reference to another .js that your current .js file code is reliant on instead of having to add 2 includes in every page to ensure that both those files are there?</p> <p>I assume the answer is no...as I have not found any info on it on the net so far.</p>
asp.net javascript
[9, 3]
1,790,631
1,790,632
Good resources for learning JavaScript
<p>Can someone suggest good learning materials or websites to learn JavaScript and jQuery? Am pretty new to this and want to learn right from basics.</p> <p>Thanks in advance, Geetha</p>
javascript jquery
[3, 5]
2,396,465
2,396,466
jQuery - choosing sum at random
<p>I am creating a "whack-a-mole" style game for primary school children where they have to click on the correct number in correspondence to the sum given. </p> <p>At the moment the program is generating addition sums like this.</p> <pre><code>function createPlusSum(total) { console.log(total) var int1 = Math.ceil(Math.random() * total); var int2 = total - int1; $('#target').html(int1 + ' + ' + int2 + ' = ?'); } </code></pre> <p>I have done this again for subtraction and it works, but I don't know where to go from here in regards to randomizing whether an addition or subtraction question is produced. Here is the function to produce a subtraction question.</p> <pre><code>function createTakeSum(total) { console.log(total) var int1 = Math.ceil(Math.random() * total); var int2 = total + int1; $('#target').html(int2 + ' - ' + int1 + ' = ?'); } </code></pre> <p>I use this to create the addition sums</p> <pre><code>createPlusSum(total); </code></pre> <p>How would I say I want </p> <pre><code>createPlusSum(total); </code></pre> <p>or </p> <pre><code>createTakeSum(total); </code></pre>
javascript jquery
[3, 5]
5,273,605
5,273,606
Jquery refresh image after source change
<p>I have a JavaScript function where I play a sound file (using phonegap). It normally works fine but I want to change the <code>img src</code> to a loading icon while the file is being downloaded. However, the src is changed after the file is played.</p> <p>I tried to add <code>+new Date().getTime()</code> to the end of src, but it didn't help. Any idea out there?</p> <pre><code>function playSound(){ var img = $(this).prev(); img.attr("src", "css/images/ajax-loader.gif?"+new Date().getTime()); var url = "http://some.com/fanky.mp3"; mediaTTS = new Media(url, onSuccessTTS(url), onErrorTTS); mediaTTS.play(); } </code></pre>
javascript jquery
[3, 5]
5,204,485
5,204,486
Click event is not triggered in jQuery
<p>I am binding a click event with an elementid like this:</p> <pre><code> $("#a").bind({click : dosomestuff }); </code></pre> <p>After that when I am trying to trigger it with the <code>.trigger()</code> function like this:</p> <pre><code> $("#a").trigger("click"); </code></pre> <p>The function is not triggering. Can anybody tell me the problem?</p>
javascript jquery
[3, 5]
1,786,289
1,786,290
javascript: problem with function
<p>I have this simple function:</p> <pre><code>&lt;script type="text/javascript"&gt; //&lt;![CDATA[ jQuery(function($){ function here(b){alert(b);} ; here(6); }); //]]&gt; &lt;/script&gt; </code></pre> <p>and i have this button on page:</p> <pre><code>&lt;button onclick="here(7);"&gt;TEST&lt;/button&gt; </code></pre> <p>The alert fires on page load, but not on button click. If i replace the here(7) with alert, it works fine. Why doesnt it work with function though?</p> <p>Alan</p>
javascript jquery
[3, 5]
1,437,561
1,437,562
Which JavaScript function is compatible with PHP urldecode function?
<p>On the server side the PHP code will be using <code>urldecode()</code> function to decode, but the JavaScript code is responsible to encode the URL. Which of the following JavaScript function is compatible with the PHP <code>urldecode()</code> function:</p> <blockquote> <ul> <li>escape() </li> <li>encodeURI() </li> <li>encodeURIComponent()</li> </ul> </blockquote>
php javascript
[2, 3]
876,734
876,735
take user to certain point on page where div fades in?
<p>Can someone please help, I am fading in several <code>div</code>'s on a page and each time the user closes one <code>div</code> another will fade in, what I want to try and achieve is a way to take the user up/down the page to the focal point of where the <code>div</code> is?</p> <p>Is this possible and if so how could i achieve it, thanks</p> <pre><code>&lt;script&gt; $(".dashboard_intro_arrow3").hide(); $(".dashboard_intro3").hide(); $(".dashboard_intro_text3").hide(); $(".exit_intro3").hide(); $(".dashboard_intro_fav").hide(); $('.exit_intro2').click(function () { if ($('.dashboard_intro2').is(":visible")) { $(".dashboard_intro2").fadeOut(500); $(".dashboard_intro_arrow2").fadeOut(500); $(".exit_intro2").fadeOut(500); $(".dashboard_intro_text2").fadeOut(500); $('.dashboard_intro_arrow3').delay(500).fadeIn(500); $('.dashboard_intro3').delay(500).fadeIn(500); $('.dashboard_intro_text3').delay(500).fadeIn(500); $('.exit_intro3').delay(500).fadeIn(500); } }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
813,587
813,588
Jquery Show Hide Function
<p>I am using the jQuery function</p> <pre><code>function ShowHide(){ $(".login").animate({"height": "toggle"}, { duration: 1000 }); } </code></pre> <p>and the link to show hide the .login div is:</p> <pre><code>onclick="ShowHide(); return false;" </code></pre> <p>But this link only toggles the div to show and hide, but I want it to also hide when the user clicks off the div, I have a page wrapper in place but just need some help with jQuery.</p>
javascript jquery
[3, 5]
5,821,815
5,821,816
Tip on building a role-based security module for rich user interfaces (Using Extensive Javascript/JQuery)?
<p>These days, building rich user interfaces for your application is very essential and im a fan of slick and easy to use interfaces.</p> <p>Today, we have sliding panels, hiding html elements, timelines ... All these use javascript/JQuery. Sometimes when used in a role-based security application. One sometimes need to enable or disable access to a very small unit of the application, like a panel within a list of panels with not disrupting the client script from executing.</p> <p>What tips can one following while building a role-based security module that would be robust to take care of todays rich user interface? </p> <p>This question applies to the <strong>.NET</strong> platform.</p> <p><strong>Update:</strong></p> <p>I know it is not wise to rely on security from the client side. What i really want to know is how you can use the server side and the client sides' ability to manipulate DOM elements to build a real role-based security module for a flexible and rich user interface.</p>
c# asp.net
[0, 9]
1,207,713
1,207,714
Add validation method to "jquery validation plugin"
<p>Hello im using jquery validation plugin to validate my form. I want to add one more rule to the validation, but cant get it to work. <strong>Input value should be less or equal previous element value.</strong></p> <p>It is possible to do it ?</p> <p>Here is the code -</p> <pre><code>&lt;input type='text' value='&lt;?php echo $count; ?&gt;' class='input_in_stock' readonly="readonly" /&gt; &lt;input type='text' name='amount[]' id='&lt;?php echo rand(0,99).$id; ?&gt;' size='1' value='&lt;?php echo $count; ?&gt;' class='required input_count' /&gt; $(document).ready(function(){ $.validator.addMethod('positiveint', function (value) { return (value &gt; 0) &amp;&amp; (value != 0) &amp;&amp; (value == parseInt(value, 10)); }, 'Enter a positive integer value.'); $.validator.addMethod('notmorethan', function (value) { return (value &lt;= $(this).prev().val()); }, 'abc.'); $("#cartform").validate({ rules: { "amount[]": { required: true, positiveint: true, notmorethan: true } }, errorPlacement: function(error, element) { error.appendTo(element.next()); } }); }); </code></pre> <p>p.s. I used this jquery validation plugin fix to make it work with names like this[] <a href="http://www.codeboss.in/web-funda/2009/05/27/jquery-validation-for-array-of-input-elements" rel="nofollow">http://www.codeboss.in/web-funda/2009/05/27/jquery-validation-for-array-of-input-elements</a></p> <p>EDIT: found the solution</p> <pre><code>$.validator.addMethod('notmorethan', function (value, element) { return (value &lt;= $(element).prev().val() ); }, 'abc'); </code></pre>
javascript jquery
[3, 5]
3,576,527
3,576,528
Conditional popup on html document close
<p>I have a content management page on my CMS on which I have a popup that warns the user on page close. It is a very simple warning implemented like so:</p> <pre><code>window.onbeforeunload = function (e) { return 'Are you sure you want to close?'; } </code></pre> <p>It works, but the problem is that the popup is shown even when the user clicks the same button. I am very new to document events so I have no idea how to do this, but I want the popup to only show when the page is being closed and not when it is being posted back.</p> <p>Also I have not used JQuery in my website so please don't suggest it; I don't want to use a whole framework just for a popup. . Thanks.</p>
c# javascript asp.net
[0, 3, 9]
378,132
378,133
run asp.net function when The page is closing
<p>I have an asp.net page when Loading this page it creates a Thread to do some thing My Question is : How to kill this thread when the user close the page ? I have tried with "onUnload" event but it just works with javascript function (as I know) and we can't use asp.net code in javascript function Do You have a way to help me ... thanks a lot</p> <p><strong>Edit:</strong> It 's difficult to explain what I am Trying to do.. The asp.net page must show a message to the user and this message must appear directly without refreshing so I was trying to use a thread which listen wait the message and then run an AJAX code to show the message ..</p>
c# asp.net
[0, 9]
2,284,107
2,284,108
Calling a Javascript function within C#
<p>I am trying to pop something based on a condition... but it is not working... and I am kind of a newbie at this so I appreciate the help</p> <pre><code>if (myFileName == OldFileName) { btnSubmit.Attributes["OnClick"] = "return confirm('This file already exists, do you want to replace it?');"; } </code></pre> <p>This is not being call for some reason.. here is the asp code</p> <pre><code>asp:Button class="Button" ID="btnSubmit" CausesValidation="True" Text="SUBMIT" runat="server" OnClick="btnSubmit_Click"&gt;&lt;/asp:Button&gt; </code></pre>
c# asp.net
[0, 9]
3,287,013
3,287,014
Dynamically added input to form doesn't validate after first validation
<p>I have a form where I add some inputs dinamically.</p> <p>Every time the user select another "fornecedor" from addMaterialFornecedor select I add a input for preco.</p> <p>My problem is that when I click the button and call the validate() function <a href="http://js.sapo.pt/SAPO/Ink/FormValidator/doc.html" rel="nofollow">http://js.sapo.pt/SAPO/Ink/FormValidator/doc.html</a> if I selected the "fornecedor"s before I click the button validate the form but if I click the button, selected the "fornecedor"s, and click again it will not validate :s</p> <p><a href="http://jsfiddle.net/rVQB4/3/" rel="nofollow">http://jsfiddle.net/rVQB4/3/</a></p> <p>the javascript code I'm using:</p> <pre><code>function formValidate(form){ if(!SAPO.Ink.FormValidator.validate(form, options)){ //some debug console.log(form); return false; }else{ //some ajax calls return false; } } </code></pre> <p>Here is a video that exlain better the problem: <a href="https://dl.dropbox.com/u/6416035/stack3.ogv" rel="nofollow">https://dl.dropbox.com/u/6416035/stack3.ogv</a> sorry my english :s thanks :) </p>
javascript jquery
[3, 5]
3,787,789
3,787,790
Correct approach using Collections with GridView control asp.net c#
<p>Here is my typical scenario:</p> <p>I have many c# business objects that more or less match my database design. I also have collections of these objects that I use to bind to gridviews. What is the best way to combine fields from both of these objects to my gridview (without using datatables or creating a view)</p> <p>Let's say I want a gridview with the following columns: Product ID, Product Name, Product Cost, Shipping Company Name. Usually I simply get my collection of products from the database and use an item template for the shipping company name. I would then get the ShippingCompanyID in the rowdatabound event and go to the database again to get my shipping company name. I hate going to the database twice, can someone coach me on how I should approach this?</p> <p>Product Class</p> <ul> <li>ProductID</li> <li>Name</li> <li>Cost</li> <li>ShippingCompanyID</li> </ul> <p>Shipping Company Class</p> <ul> <li>ShippingCompanyID</li> <li>Name</li> </ul>
c# asp.net
[0, 9]