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
3,528,489
3,528,490
Do something on page load, based on a previous page action
<p>I am building a site on wordpress and I have encountered a problem that I am not quite sure how to solve. </p> <p><strong>The Situation:</strong></p> <ol> <li>User makes a selection from a <code>&lt;select&gt;</code> tag on one page and submits their choice</li> <li>User arrives at a page featuring the same <code>&lt;select&gt;</code>. When the user selects an option, it displays content corresponding with that option using a little bit of jQuery. </li> </ol> <p>-</p> <pre><code>$('.result').hide(); $('#servicearea').change(function() { $('.result').hide(); var optionValue = $ (this).attr('value'); $('#'+optionValue).show('fast'); }); </code></pre> <p><strong>The Problem:</strong></p> <ol> <li>I need the selection from the first page to carry over to the second page then run this script. </li> </ol> <p><strong>Solutions:</strong></p> <ol> <li>I'll be honest, I don't know where to start with this, maybe cookies? I was hoping there was a jQuery type of solution as I am sort of comfortable with jQuery. </li> </ol> <p>Any suggestions would be appreciated.</p>
php jquery
[2, 5]
3,529,136
3,529,137
Asp.net page unable to read the HttpPost Data when submited from android
<p>I'm new in Android programming, and I have try to submit some login data to an. aspx page for verification via POST Method, some how I notice that the .aspx page was unable to read the HttpPost data from my android app. 2 thing I have tried to submit my data to an .asp page, the page able to read the data using the same code, except change the URL in it, and 2nd. I also create a simple html file to submit the data to .aspx page, it seem no problem reading POST Method data, so now I have no clue what is going wrong here.</p> <pre><code> DefaultHttpClient client = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.mydomain.com/login.aspx"); httppost.addHeader("Content-type", "application/x-www-form-urlencoded"); List&lt;BasicNameValuePair&gt; nvps = new ArrayList&lt;BasicNameValuePair&gt;(); nvps.add(new BasicNameValuePair("strEmail", username)); nvps.add(new BasicNameValuePair("strPassword", password)); try { UrlEncodedFormEntity p_entity = new UrlEncodedFormEntity(nvps, HTTP.UTF_8); httppost.setEntity(p_entity); HttpResponse response = client.execute(httppost); ........ ........ </code></pre> <p>The aspx page bascially do nothing much, it just get the data via Request.Form("strEmail") and Request.Form("strPassword") and compare it against the database then pass back and XML result page. So any one have any idea what is missing there?</p>
asp.net android
[9, 4]
398,593
398,594
asp.net javascript message not showing up
<p>I have a button and onclick is set to this method which should display a simple JS alert pop up window:</p> <pre><code>string message = "File is already open. &lt;br&gt;Please close the file and try again."; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("&lt;script type = 'text/javascript'&gt;"); sb.Append("window.onload=function(){"); sb.Append("alert('"); sb.Append(message); sb.Append("')};"); sb.Append("&lt;/script&gt;"); ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString()); </code></pre> <p>I have used the code above before and it has worked but not this time. The only difference is that I was using master pages for the other site and not for this one, and this one also has a timer going.</p> <p>Is there anything JS related to load in the <code>&lt;head&gt;</code> of the aspx page?</p> <pre><code>protected void btnToCSV_Click(object sender, EventArgs e) { try { StreamWriter writer = new StreamWriter(@"\\server location\test.csv"); Some writer.write stuff... writer.Close(); } catch (Exception ex) { lblMessage.Visible = true; string message = "File is already open. Please close the file and try again."; ClientScript.RegisterClientScriptBlock( this.GetType(), "alert", string.Format("alert('{0}');", message), true); } } </code></pre>
c# javascript asp.net
[0, 3, 9]
5,553,856
5,553,857
Very basic Code Performance
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/24901/is-there-a-performance-difference-between-i-and-i-in-c">Is there a performance difference between i++ and ++i in C++?</a> </p> </blockquote> <p>Can anybody explain me why ++i is faster then i++ when we want to increment integer value I guess it might refer to any programming language.</p>
c# java c++
[0, 1, 6]
3,269,147
3,269,148
Detect Arabic language using Javascript?
<p>How to detect Arabic language when typed in a Textbox using a Javascript?? Is there any way to do this.</p> <p>I want to do a system where the system automatically detects the Arabic Language written in the textbox of the Webpage.</p>
javascript asp.net
[3, 9]
298,325
298,326
android is my application still running?
<p>i have this thread which run as a service:</p> <pre><code> public void run() { try { while(true) { Thread.sleep(timeInterval); results = sendGetMessage(); b.putString("results", results); receiver.send(2, b); } } catch (InterruptedException e) { results = e.toString(); } this.stop(); } </code></pre> <p>i want to write a simple function which will check if my application is still running (in order to replace the everlasting while(ture) i've written). something like: while(isMyAppRunning). my problem now that even when i'm closing the app, the service keep on running.. can someone please be kind and give me a code example?</p>
java android
[1, 4]
3,686,055
3,686,056
Neatening up custom event handlers - remove need for 'event' parameter
<p>I'm building some objects that will trigger custom events, and I'm using jQuery's bind and trigger to manage this for me, like so:</p> <pre><code>function MyObject() { var _this = this; this.onUpdate = function(fn) { $(_this).bind('MyObject.update', fn); }; this.update = function(params) { //Do stuff... $(_this).trigger('MyObject.update', [updatedID]); }; } </code></pre> <p>My problem is when I come to register other callback functions with onUpdate - the functions I pass in need to include the 'event' parameter for trigger to work correctly, like so:</p> <pre><code>function myCallback(event, updatedID) { //Do more stuff... } var myobject = new MyObject(); myobject.onUpdate(myCallback); </code></pre> <p>Is there a nice way I can wrap the function that I pass in to bind in the onUpdate method, so that myCallback doesn't need the 'event' parameter, as it seems a bit irrelevant for my purposes?</p>
javascript jquery
[3, 5]
5,070,739
5,070,740
Custom jQuery scrollbar inside jQuery tooltip
<p>I'm using nanoscroller.js and tiptip.js , although for my question I'm not sure specific libraries matter that much (but they may).</p> <p>I have a working tool tip, I have a working scrollbar. When used seperately.</p> <p><strong>My goal</strong> is to have a working custom scrollbar inside the tooltip.</p> <p><strong>HTML:</strong></p> <pre><code>&lt;a class="tooltip"&gt;Open tooltip&lt;/a&gt; &lt;div class="tooltip-html" style="display:none;"&gt; &lt;div id="main-content" class="nano"&gt; &lt;div class="Content"&gt; &lt;div class="blue"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>JS:</strong></p> <pre><code>var tip_html = $('.tooltip-html').html(); $('.tooltip').tipTip({activation: 'click', maxWidth: "230px", defaultPosition: "bottom", keepAlive: true, content: tip_html }); $("#main-content.nano").nanoScroller(); </code></pre> <p>First thing I noticed about the above: With this arrangement the nanoscroller was only applied to the first set of html, not the set that is in the tooltip.</p> <p>So I then applied the scrollbar first before grabbing the html and adding it to the tooltip, this applied the scrollbar to the tooltip but it wasn't functional.</p> <p>Tried a lot of different approaches here (applying the scrollbar to every id that matched, different order of when to call which, etc), and I'm definitely stuck. Any help is appreciated, thanks!</p>
javascript jquery
[3, 5]
905,630
905,631
Prototype.js error on a function
<p>I am getting error on following function:</p> <pre><code>Event.observe(window, "load", function () { if ($("question") &amp;&amp; $("question").type.toLowerCase() == "textarea") { Event.observe("question", "keyup", function () { var _4 = $F("question"); if (_4.length &gt; 255) { $("question").value = _4.substring(0, 255); } }); } }); </code></pre> <p>type is null or not an object.</p> <p>in prototype.js it gives error on:</p> <pre><code> var respondersForEvent = registry.get(eventName); if (Object.isUndefined(respondersForEvent)) { respondersForEvent = []; registry.set(eventName, respondersForEvent); } </code></pre>
javascript jquery
[3, 5]
2,926,693
2,926,694
jQuery find not working
<p>This is my HTML:</p> <pre><code> &lt;p class="first"&gt;blah blah &lt;a href="" class="more"&gt;read more&lt;/a&gt;&lt;/p&gt; &lt;div class="read_more"&gt; &lt;p&gt;more text&lt;/p&gt; &lt;/div&gt; </code></pre> <p>And javascript:</p> <pre><code>$(document).ready(function(){ $('a.more').click(function(){ $(this).find('.read_more').slideDown(); return false; }); }); </code></pre> <p>Doesn't seem to do anything (read_more is set to display: none) any ideas?</p>
javascript jquery
[3, 5]
3,463,338
3,463,339
How to change time zone for an asp.net application
<p>I need to set default timezone for my ASP.NET to Asia/Dhaka or GMT+6 timezone. But i cannot find a way to change it globally. There is a lot of reference on Stackoverflow and rest of the web for doing this by getting timezone info and calculating correct time for each time i need a DateTime object.</p> <p>But trust me, I don't want to do this in this way. So dont give me any suggestion like that. I want to set the timezone to Asia/Dhaka or GMT+6 preferably from web.config. (Similar we do in php with php.ini) So that each time i need DateTime object the time is evaluated with my timezone no matter what the timezone is for server.</p> <p>Is this possible? If possible then how?? Thanks in advance for the solution :)</p>
c# asp.net
[0, 9]
2,506,839
2,506,840
Dynamically created text box's ontextchanged event not firing when assigned an ID
<p>I read all related posts , but still could not understand the prob that am currently facing.On Oninit I create table with text boxes as follows, when i assign an id to the text box the textchanged event does not fire, but when i do not assign an ID it fires. Cant reason out why. Kindly help.</p> <pre><code> protected override void OnInit(EventArgs e) { PopulateTextBoxes(); base.OnInit(e); } protected void PopulateTextBoxes() { int quantityRequired = 0; quantityRequired =GetQuantity(); for (int j = 0; j &lt; quantityRequired; j++) { TableRow row = new TableRow(); TableCell cell1 = new TableCell(); TextBox tb = new TextBox(); //tb.ID = j.ToString() +":RowTbx";---&gt; this when uncommented does not fire my tb_textChanged event while left commented the textchanged event is fired. Cant understand why? How is assigning an ID affect event Firing, I need to have the ID to further update my Db. tb.AutoPostBack = true; tb.TextChanged += new EventHandler(tb_TextChanged); cell1.Controls.Add(tb); row.Cells.Add(cell1); TableCell cell2 = new TableCell(); CheckBox chBox = new CheckBox(); chBox.CheckedChanged += new EventHandler(chBox_CheckedChanged); chBox.AutoPostBack = true; cell2.Controls.Add(chBox); row.Cells.Add(cell2); TableCell cell3 = new TableCell(); Image img = new Image(); img.Width = Unit.Pixel(25); img.Height = Unit.Pixel(25); img.ImageUrl = "HttpRuntime.AppDomainAppVirtualPath" + "/Images/" +"img.jpeg"; cell3.Controls.Add(img); row.Cells.Add(cell3); tbl_Serial.Rows.Add(row); } } private void tb_TextChanged(object sender, EventArgs e) { // TODO: Implement this method //throw new NotImplementedException(); } </code></pre> <p>Thank you</p>
c# asp.net
[0, 9]
3,969,202
3,969,203
asp.net jquery id selector in content page
<pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $(".div_soru").toggle(function () { var cevap = "cevap" + $(this).attr("id"); $("xxx").slideDown(); // }, function () { var cevap = "cevap" + $(this).attr("id"); $("xxx").slideUp(); }); }); &lt;/script&gt; </code></pre> <p>in my content page :</p> <pre><code>&lt;asp:Repeater ID="Repeater_sorular" runat="server" DataSourceID="SqlDataSource_sss"&gt; &lt;HeaderTemplate&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;div&gt; &lt;div class="div_soru" id='&lt;%# Eval("sss_id") %&gt;'&gt; &lt;strong&gt;&lt;%# Eval("sss_baslik") %&gt;&lt;/strong&gt; &lt;/div&gt; &lt;div class="div_cevap" id='&lt;%# "cevap"+Eval("sss_id") %&gt;' style="display: none; padding: 5px 5px 5px 15px;"&gt; &lt;%# Eval("sss_icerik") %&gt; &lt;/div&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>in script code,i want write id=cevap, what i write instead of "xxx" i cant find correct syntax. in master page , when write $("#" + cevap) it works. but in content page, it doesnt work.</p> <p>thanks...</p>
jquery asp.net
[5, 9]
1,419,832
1,419,833
Custom dialog box to get confirmation when browser tab is closed
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2132760/how-to-ask-confirmation-when-closing-a-window">How to ask confirmation when closing a window?</a> </p> </blockquote> <p>I would like to display a confirmation box and a custom message when the browser tab is closed. Users can click OK to actually close the tab, and CANCEL to stay on the page.</p> <p>The following is my code. Can someone tell me how I can make it work?</p> <pre><code> window.onbeforeunload = function (e) { e = e || window.event; // For IE and Firefox prior to version 4 if (e) { e.returnValue = 'ARE you sure?'; } // For Safari return 'ARE you sure?'; }; </code></pre>
javascript jquery
[3, 5]
5,124,975
5,124,976
How to modify a php string variable in javascript
<p>I am using php4 and jquery, I have got a php string variable $content which stores a string as shown below.</p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;comments:&lt;/td&gt; &lt;td&gt;Good&lt;/td&gt; ..... ...n rows &lt;/table&gt; &lt;/html&gt; </code></pre> <p>So, Now i want to change the color of <strong>all occurrences of text "Good"</strong> to red. So How to write a jquery function which takes a php string $content variable and changes the color of each "Good" word, (adds a style color:red) and returns it.</p>
php javascript jquery
[2, 3, 5]
1,110,393
1,110,394
Click event not firing with dynamically create buttons
<p>I have dynamically created the buttons in a div. And binding the click and other events for the buttons. But the problem is, click event fired only one for first clicked button. It happens same for the other binding events. The sample code is </p> <pre><code> $('#divButtons input[type=button]').each(function () { $(this).bind('mouseover', function (e) { // some work }).bind('mouseout', function (e) { // some work }).bind('click', function (e) { // some work }); }); </code></pre> <p>It works good when bind it on <code>document.ready()</code> But in my case buttons created far after DOM ready.</p> <p>I also want to know why it behaves like this...?</p>
javascript jquery
[3, 5]
4,779,970
4,779,971
Why isn't this second table not visible?
<p>I have two tables in a page like this:</p> <pre><code>&lt;table style="width:800px"&gt; &lt;tr&gt; &lt;td style="width:400px;"&gt; &lt;table id="currencies" style="border-spacing: 5px; padding: 3px; margin: 2px" /&gt; &lt;/td&gt; &lt;td style="width:400px;"&gt; &lt;table id="changers" style="border-spacing: 5px; padding: 3px; margin: 2px" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>I use jqgrid to extend these. One is the master table while the other is the detail. The problem however is the second table (id = "changers") is not being displayed in the page. I inspected the javascript from the browser and it has only one <code>&lt;td&gt;</code> element within the table row. This problem goes away if I put them in separate tables like so:</p> <pre><code>&lt;table id="currencies" style="border-spacing: 5px; padding: 3px; margin: 2px" /&gt; &lt;table id="changers" style="border-spacing: 5px; padding: 3px; margin: 2px" /&gt; </code></pre> <p>I'm totally stuck on this. Any help is appreciated.</p>
javascript jquery
[3, 5]
5,369,971
5,369,972
how to close light box form after clicking on submit button?
<p>i have a light box form ( and have page in the background ).i want to close the light box and stay on that page after clicking on submit button .but its redirecting to another page ( php database connection page ) after clicked on submit button.need help.i want to know how to close light box and stay on that page.thank you!</p>
php javascript
[2, 3]
3,912,097
3,912,098
remove %0A from string
<p>how can i remove %0A from this string :- this is enter key code, which i need to remove from entire string. so how can i do this? </p> <p><strong>input:-</strong></p> <p>"NA%0A%0AJKhell this is test %0A"</p> <p><strong>Output:-</strong></p> <p>NAJKhell this is test </p> <p><strong>Update</strong></p> <pre><code>String Comment = cmment_comment_edtx.getText().toString().trim(); String query = URLEncoder.encode(Comment, "utf-8"); System.out.println("comment edit is "+query); query.replace("$0A", ""); String query2 = URLEncoder.encode(query, "utf-8"); </code></pre>
java android
[1, 4]
4,450,878
4,450,879
Is there a good library of video tutorials for Android development?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4904560/where-can-i-find-android-video-tutorials">Where can I find Android video tutorials?</a> </p> </blockquote> <p>Specifically some that may cater to an experienced developer (C#) but not necessarily familiar with Java/Eclipse?</p> <p>I have seen a couple vids on YouTube but they are either short (not much you can learn in 3mins or patronizing)</p>
java android
[1, 4]
2,308,211
2,308,212
Easy way to bind dynamic elements without having to recall functions jquery
<p>I currently have a page in which users can drag content around, resize it, etc. </p> <p>The basic structure looks like the following:</p> <pre><code>$('.element').on().resizable().draggable(); </code></pre> <p>When called at the beginning of the document load it adds bind events, resizable and draggable. Now the problem I have is that a user can add in new elements dynamically. These new elements are no longer covered by the above code. What I ended up doing is the following:</p> <pre><code>function bindEvents(){ $('.element').on().resizable().draggable(); } </code></pre> <p>bindEvents();</p> <p>And then when elements are added I turn off the current implementation and then turn it on again so that it will include the new elements:</p> <pre><code>$('.element').off().resizable("destroy").draggable("destroy"); bindEvents(); </code></pre> <p>No I know this is incredibly inefficient and most likely uses way more memory than needed. My question is, is there a better way to do this? Is there a way to add the one particular element to the already established group of bound elements?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
2,978,334
2,978,335
Is there a way to grab the x and y position of an element on a page without it being absolute using jquery?
<p>Is there a way to grab the x and y position of an element if it's not positioned absolute using jquery?</p>
javascript jquery
[3, 5]
482,311
482,312
Request form error for panel in asp.net
<p>I have two panels , when i tried to come back from panel 2 to panel one it shows me </p> <pre><code>Reques form error potentially dangrous </code></pre> <p>Any help appriciate</p>
c# asp.net
[0, 9]
1,299,771
1,299,772
How to make these simple javascript lines into a loop
<p>I'm just starting to learn javascript, and I've written the following code (coming from a php background):</p> <pre><code>$(document).ready(function(){ $("#example-1").attr("rel","1"); $("#example-2").attr("rel","2"); $("#example-3").attr("rel","3"); }); </code></pre> <p>I'm assuming that making it into something more like this would be faster and use less resources (even if it's miniscule):</p> <pre><code> jQuery(document).ready(function(){ foreach #example-X i++ $("#exmaple-[i]").attr("rel","[i]"); }); </code></pre> <p>How can I do that?</p>
javascript jquery
[3, 5]
2,888,652
2,888,653
Get inputs value and separated by "|"
<p>I have inputs and I need to get values and separated by <code>"|"</code> symbol.</p> <p>My input:</p> <p><img src="http://i.stack.imgur.com/BVsDV.png" alt="enter image description here"></p> <p>Output what I need:</p> <p><strong>00:00|00:00|00:00</strong></p> <p>My code is :</p> <p>(and it's not working)</p> <pre><code>var timesArray = $('table').find('input'); var times = timesArray.val(); $('.alltimes').val(times); </code></pre>
javascript jquery
[3, 5]
4,638,524
4,638,525
Getting Previous Date Using Javascript
<p>I want to get the before six months date using javascript. </p> <p>I am using the following method.</p> <pre><code>var curr = date.getTime(); // i will get current date in milli seconds var prev_six_months_date = curr - (6* 30 * 24 * 60* 60*1000); var d = new Date(); d.setTime(prev_six_months_date); </code></pre> <p>Is this the right way or any better way to get the last six months date.</p> <p>If this get fixed I want to apply this logic to get previous dates like last 2 months and last 10 years etc.</p> <p>If any body give the solution in jquery also very helpful to me. Thanks in advance.</p>
javascript jquery
[3, 5]
4,100,424
4,100,425
how to convert javascript variable to PHP variable?
<p>I would like to convert my javascript variable to a PHP variable...<br> Right now I have situation like that, in the code below I have a variable <code>e</code> , but I want to use <code>e</code> in PHP like <code>$e</code>:</p> <pre><code>&lt;script&gt; function test() { var e = document.getElementById("category_id_video").value; alert(e); } &lt;/script&gt; &lt;?php if(isset($_GET['e'])) { echo $video_player_id = $_GET['e']; } ?&gt; </code></pre>
php javascript
[2, 3]
1,406,938
1,406,939
Disabled JavaScript in IE6 still not able to see the script code?
<p>I m a beginner. This is more related to different options i was trying to learn.</p> <p>I just took example </p> <pre><code> &lt;!-- document.write("&lt;h1&gt;Hello World&lt;/h1&gt;"); //--&gt; </code></pre> <p>It was stated that we should use this tags to avoid the script display in browser if javascript is disabled. So Disabled Javascript By following steps as</p> <p>Click on the Tools menu Choose Internet Options... from the menu Click the Security tab on the Internet Options pop up Click the Custom Level... button to access your security settings Scroll almost all the way down to the Scripting section Select the Enable button for Active scripting Click OK to finish the process Click Yes when asked to confirm</p> <pre><code> document.write("&lt;h1&gt;Hello World&lt;/h1&gt;"); </code></pre> <p>Then i removed the tags and now i was expecting that i will be able to see the error that is script</p> <pre><code> "document.write("&lt;h1&gt;Hello World&lt;/h1&gt;");" </code></pre> <p>displayed as it is as Javascript is disabled and tags are removed. But what i see is nothing displayed empty page. Can some1 help me understand this?</p>
javascript asp.net
[3, 9]
3,657,292
3,657,293
Array to javascript
<p>I have an array of items from the database.</p> <pre><code>`$this-&gt;ingredientsHistory` is the variable that contains the array. </code></pre> <p>I want to convert this into a javascript var that will hold them all and I can then use them in the autocomplete jquery UI function.</p> <p>I've tried <code>var ingredients = &lt;?php echo json_encode($this-&gt;ingredientsHistory); ?&gt;</code> </p> <p>This is an example of a <code>print_r($this-&gt;ingredientsHistory);</code> output...</p> <blockquote> <p>Array ( [0] => Array ( [name] => oranges ) [1] => Array ( [name] => chicken ) )</p> </blockquote> <p>Any help would be appreciated.</p> <p>Edit - more information:</p> <pre><code>$(function() { var ingredients = &lt;?php echo json_encode($this-&gt;ingredientsHistory); ?&gt;; console.log(ingredients); //this is the default tags that jquery gives me - i need to turn ingredients into something similar. var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; $( "#tags" ).autocomplete({ source: ingredients }); </code></pre> <p>});</p>
php javascript jquery
[2, 3, 5]
2,499,239
2,499,240
Animated sliding divs on click button, .prev .next jQuery
<p>Trying to make a sliding panel where you can click next and back to go between panes, Ive attached a fiddle to explain better, only my back button doesnt seem to work, Can anybody see why?</p> <p><a href="http://jsfiddle.net/x2qk7/3/" rel="nofollow">http://jsfiddle.net/x2qk7/3/</a></p>
javascript jquery
[3, 5]
1,335,759
1,335,760
Javascript for .NET 3.5: How to give textbox focus after a pop-up is closed
<p>Is there a way to open a pop-up via window.open(....), let it stay on top of the main window, and upon its close, give focus to a text box on the calling page?</p> <p>I have been tasked to adjust functionality written by someone else. The .NET 3.5 page currently allows restocking of inventory and upon a button click, a new popup displays a receipt. The html for the pop-up is stored in a hidden field and is opened by a call to a js function. </p> <p>On the page is also a text box which I have been asked to keep focus in. I have it working except for when the receipt is displayed. If I call a server or client side function to maintain focus of textbox, the pop-up window appears on top of the main window for a second and then is overlayed by the main page because the textbox receives focus, and that is not what is desired.</p>
c# javascript asp.net
[0, 3, 9]
4,805,488
4,805,489
vanilla javascript vs jquery
<p>I am having trouble grasping the difference between the two. I tried downloading the library and there was no code. I am trying to build a basic slider along with other basic functions I have built in jQuery. Any help, tutorials, plugins and information would be very helpful!</p>
javascript jquery
[3, 5]
111,587
111,588
How to check if a text is all white space characters in client side?
<p>How to check if a user input text is all white space characters (space, tab, enter etc) in client side?</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
4,555,746
4,555,747
JQuery form auto submit clicking out side the div
<p>I want to auto-sumbit my form once user clicks out side the div of the form.</p> <p>I tried the following but it submits within clicking within the div.</p> <pre><code>&lt;div id="formDiv"&gt; &lt;form id="search"&gt; &lt;input id="target" type="text" value="Field 1" /&gt; &lt;input type="text" value="Field 2" /&gt; &lt;/form&gt; &lt;/div&gt; // auto submit jQuery('#formDiv').live('blur',function() { $(this).children('form').submit(); }); </code></pre>
javascript jquery
[3, 5]
2,346,090
2,346,091
javascript convert <string, string[]> to <string, string>
<p>I have a javascript object with key/value pairs where the value is an array of strings:</p> <pre><code>var errors = { "Message": ["Error #1", "Error #2"], "Email": ["Error #3", "Error #4"] }; </code></pre> <p>I would like to convert this to a key/value pair with the first element of each array so that it is a instead of :</p> <pre><code>var firstErrorOnly = { "Message": "Error #1", "Email": "Error #3" }; </code></pre> <p>I tried doing this using <code>jQuery.map</code> but I was not getting the results I wanted. How can I accomplish this?</p>
javascript jquery
[3, 5]
3,914,479
3,914,480
send confirmation mail via ASP.NET
<p>I'm trying to send a confirm registration mail. I don't want to use the SMTPs for gmail or windows Live as it is not legal and can not be used for those type of purposes.</p> <p>Is there any mailing service that is accessible by code which can satisfy my requirements in a legal way?</p> <p>I'm using ASP.NET Framework 3.5.</p>
c# asp.net
[0, 9]
5,621,771
5,621,772
return values from sql query when ajaxform is applied
<p>I got a </p> <p>$.ajax({</p> <pre><code>type: "get", url: "detail.php", data: "iq="+q, success: function() { $('#Title').text('value',''); } </code></pre> <p>and a sql query select statement. I want to return the value from the sql statement to #Title on the php page.</p> <p>Thanks Jean</p>
php jquery
[2, 5]
5,888,740
5,888,741
Why is $(this).val() giving me the value from this first method in this second method?
<p>The $(this).val() in the second method returns the same value that I get in the first method. I expected to get the first value of the fields with the secondGroup class. What am I doing wrong?</p> <pre><code>$(document).ready(function(){ jQuery.validator.addMethod("method1", function(value, element, options) { .....some code here.... var elems = $(element).parents('form').find(options[0]); jQuery.each(elems, function(){ thisVal = $(this).val(); }); .....some code here...... }, jQuery.format("some message.")); jQuery.validator.addMethod("method2", function(value, element, options) { .....some code here.... var elems = $(element).parents('form').find(options[0]); jQuery.each(elems, function(){ thisVal = $(this).val(); }); .....some code here...... }, jQuery.format("some message.")); $("#formName").validate({ rules: { firstMethod1:{ method1: ['.firstGroup'] }, secondMethod1:{ method1: ['.firstGroup'] }, thirdMethod1:{ method1: ['.firstGroup'] }, firstMethod2:{ method2: ['.secondGroup'] }, secondMethod2:{ method2: ['.secondGroup'] }, thirdMethod2:{ method2: ['.secondGroup'] } } }); }); </code></pre>
javascript jquery
[3, 5]
5,117,657
5,117,658
noob: how to show login error message on the same page after php server processes request
<p>I have a login page. User first enters information and submits the form. </p> <p>And I have a php script that will see if the user exists.</p> <pre><code>If( authenticated == true) { // I do a redirect } else { // I want to popup an error message on the same page. } </code></pre> <p>1) I'm not sure how to show the popup message, I would like to make my div element visible with an error message returned from the server,<br> I would have to use Ajax, right? But how?</p> <p>Or are there alternatives which are just as good.</p>
php javascript
[2, 3]
68,407
68,408
Label's text appeared nothing when is session over from the first page
<p>I am trying to Session over my Label.Text in the first .aspx page to another Label in the second .aspx page. I retrieve my value from the database and place them in the first Label.Text and want to Session this Label (Which i got the text from the database) to another page linked to the first page. I use this method is because i have a detailed products page (My first .aspx page) which consists of many products and when user click a particular product, it's product name have to be displayed in the second page of the .aspx . My problem here is that when i Session over the Label's text on the first page, the value does not pass over to another page. </p> <p>My first page's .cs code (code behind):</p> <pre><code>Session["productName"] = productName.Text; Response.Redirect("products2.aspx"); </code></pre> <p>My second page's .cs code (code behind - I place this code in page load)</p> <pre><code>if (Session["productName"] != null) productName.Text = Session["productName"].ToString(); </code></pre> <p>Have i gone wrong anywhere?</p>
c# asp.net
[0, 9]
4,023,207
4,023,208
Why does jQuery not register my <a> click?
<p>In the example below</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="#"&gt;test&lt;/a&gt; &lt;button id="btn-add"&gt;Add&lt;/button&gt; &lt;div id="placeholder"&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $('a').on('click', function () { alert('clicked'); }); $("#btn-add").on("click", function () { $('#placeholder').prepend('&lt;a href=\'#\'&gt;blah2&lt;/a&gt;'); }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>If you click on 'Add' then 'blah2' nothing happens even though I am trying to alert on any anchor click. As a check if you click on 'test'you get the popup</p>
javascript jquery
[3, 5]
3,552,419
3,552,420
Access a php array of indexed objects with jquery
<p>I have a php array of objects istantiated from the following class:</p> <pre><code>class my_class { public $id; public $timestamp; } </code></pre> <p>These are stored in an array with indexes 0,1,2.....</p> <p>I am getting this array with jquery through the Session variable and I attempt to print it in the following ways:</p> <pre><code>var myclass_map = "&lt;?php $_SESSION['myclass_map']?&gt;"; $.each(myclass_map, function(key, value) { console.log(key + ' ' + value["id"]); }); </code></pre> <p>and </p> <pre><code>var track_map = "&lt;?php $_SESSION['myclass_map']?&gt;"; $.each(myclass_map, function(key, value) { console.log(key + ' ' + value.id); }); </code></pre> <p>but both give me an undefined reference to value while the print out the key. How can I access the objects variables?</p>
php jquery
[2, 5]
3,748,713
3,748,714
JavaScript function that returns result of ajax call
<p>Help needed. Im writing a function that returns result of ajax call but i did not get any results, i guess it's a scope issue, but is there any way to do it? Here is my code:</p> <pre><code>function Favorites() { var links; $.ajax({ type: "GET", url: "/Services/Favorite.svc/Favorites", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", cache: false, success: function(msg) { links = (typeof msg.d) == 'string' ? eval('(' + msg.d + ')') : msg.d; } }); return links; }; </code></pre>
javascript jquery
[3, 5]
3,117,796
3,117,797
how can i execute large mysql queries fast
<p>I have 4 mysql tables and have a single query with JOIN on multiple tables and I am requesting it via jquery ajax, but it takes much too long, from about 1-3 minutes while I want to execute them on average 2-5 seconds.</p> <p>Is there any special way to execute the queries fast?</p>
php jquery
[2, 5]
4,778,581
4,778,582
How to handle the reported and spammed comments in website using asp.net by moderator?
<p>I am building a social bookmarking website . Users will be able to comment upon the bookmarks added . Thus a working is required to eliminate the spam and unnecessary ads. Moderator should be able to perform following:</p> <ol> <li>Check the comment or receive notification when a user reports the comment</li> <li>Edit the reported comment or delete the inappropriate </li> <li>Generate reports for the administrator </li> </ol> <p>As I'm a new developer I'm finding it difficult to come with ideas, and a search on Google gave me nothing. I want to do this all using c#.</p>
c# asp.net
[0, 9]
5,413,179
5,413,180
Comparing strings in android
<p>I want to compare a string literal that is "failed" to a string that has been passed to this function, but my problem is that the string that is passed "result" is not the same as the string fail, and i explicitly passed "failed" to the function. </p> <pre><code> if(result.equals(fail)) </code></pre> <p>always returns false for me</p> <pre><code>protected void onPostExecute(String result) { super.onPostExecute(result); TextView data_details = (TextView)findViewById(R.id.results_tab); data_details.setText(result); // THIS PRINTS OUT THE VALUE TO SCREEN WHICH IS 'failed' String fail = "failed"; if(result.equals(fail)) { Intent redirect = new Intent(LogActivity.this, MainActivity.class); redirect.putExtra("error", result); startActivity(redirect); finish(); } } </code></pre> <p>And also I tried:</p> <pre><code>if(result.equalsIgnoreCase("failed")) </code></pre>
java android
[1, 4]
838,085
838,086
How to open a pop up window using javascript/Jquery for firefox browser?
<p>How to open a pop up window using javascript/Jquery for firefox browser?it is working in other browsers except firefox.</p> <pre><code> &lt;xsl:if test="$ShowRejectLink='Yes'"&gt; xsl:if test='$RejectLink!=""'&gt; &lt;a href="{$RejectLink}" target="_new"&gt;Reject&lt;/a&gt; </code></pre> <p>If i click this link means.it will open the pop up window</p> <p><a href="http://localhost:6060/jsp/rejectPopup.jsp?id=166899&amp;responseStatusId=2&amp;ApprovalFlag=true" rel="nofollow">http://localhost:6060/jsp/rejectPopup.jsp?id=166899&amp;responseStatusId=2&amp;ApprovalFlag=true</a></p>
javascript jquery
[3, 5]
4,952,278
4,952,279
Show tab without refreshing whole page
<p>I have following code in my php page. These are two tabs Inbox and sInbox. When user clicks on them it refreshes whole page to go to other tab. Is there a way to make these tabs so that when user click on one of the tab there is no page refresh? When answering please provide full code example as i am a beginner.</p> <pre><code> &lt;ul id="topTabs"&gt; &lt;li class="selected"&gt;&lt;a href="acc/inbox"&gt; Inbox &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="acc/sinbox"&gt; sInbox &lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre>
php jquery
[2, 5]
933,775
933,776
Dynamically arrange some elements around a circle
<p>I'm looking for a function to arrange some elements around a circle.<br> result should be something like : </p> <p><img src="http://i.stack.imgur.com/gEpQW.jpg" alt="enter image description here"></p>
javascript jquery
[3, 5]
5,720,385
5,720,386
How to detect if the call is made through jQuery
<p>I use </p> <p><code>$.post('ajax/test.php', function(data) { $('.result').html(data);});</code></p> <p>to send data and retrieve information and show it to the user. But "hackers" can access my file (test.php) just typing it in URL. Is it possible to detect if the call is made from jQuery or not?</p>
php javascript jquery
[2, 3, 5]
2,945,523
2,945,524
Asp.net Head Problem
<p>i want to write head tag.</p> <p>i need create dynamic</p> <pre><code>&lt;head id="htmlHead" runat="server"&gt; &lt;/head&gt; </code></pre> <p>code behind:</p> <pre><code>htmlHead.InnerText = "&lt;script src=\"Scripts/jquery.ui.datepicker.js\" type=\"text/javascript\"&gt;&lt;/script&gt;" </code></pre> <p>not work pls help </p>
c# asp.net
[0, 9]
1,206,763
1,206,764
Unable to get jQuery '+variable+' within selector working
<p>I am trying to change images based on the first character inside an h2 tag that corresponds to the id of a collection of images within a div called jquery_image</p> <p>If I have the following code then my images will change as expected</p> <pre><code>$(".jquery_image img:not([id=1)").hide(); $(".jquery_image img[id=2]").show(); </code></pre> <p>However as soon as I try to change the images using the variable jTitle nothing happens</p> <pre><code>var jTitle = ($(this).text().substring(0,1)); // alert(typeof jTitle); &lt;&lt; string $(".jquery_image img:not([id='+jTitle+'])").hide(); $(".jquery_image img[id='+jTitle+']").show(); </code></pre> <p>Why does this code not work? What am I doing wrong. Thanks</p>
javascript jquery
[3, 5]
3,310,247
3,310,248
jquery multiselect checkbox values
<p>I'm using the Jquery multiselect checkbox plugin and am getting an error when converting the returned (CSV) values into an array. While this is not, strictly, a jQuery question it seems to throw an error on a standard js method. Heres what I have:</p> <pre><code>$(function(){ $("select").multiselect({ click: function(e){ if( $(this).multiselect("widget").find("input:checked").length &gt; 4 ){ return false; } }, close:function(evt, ui) { // Get the selected values upon close var which = $(this).attr('id'); // Find out which selectbox was open var checkedVals = $('#'+which).val(); // Get CSV string of checked options var valArray = checkedVals.split(','); // convert CSV string to array for(a in valArray) { currentBox = ('#'+which+'Box'); // Find current selectbox wrapper var eHeight; eHeight = $('p'+currentBox).height(); // Current wrapper height $('p'+currentBox).height(eHeight+18); // Add 18px to current wrapper for each Value $('p'+currentBox).append('&lt;div style="line-height:18px; margin-left:90px;"&gt;&lt;a href="#"&gt;&lt;img class="deleteVal" src="images/closewin.png" align="texttop" border="0"&gt;&lt;/a&gt; '+valArray[a]+'&lt;/div&gt;'); } } }).multiselectfilter(); </code></pre> <p>I get back a comma separated string which I want to put into an array using js. The error - "checkedVals.split is not a function" - is thrown at this line: var valArray = checkedVals.split(',');</p>
javascript jquery
[3, 5]
4,582,216
4,582,217
Mail through Javascript
<p>How can we <strong>send mail</strong> using JavaScript? </p>
php javascript
[2, 3]
3,387,771
3,387,772
firewall for mobile devices running on android platform
<p>i am developing a firewall for mobile devices as my final year project could anybody help me out in getting the codes for any of my project...pls pls pls its urgent!</p>
java python
[1, 7]
2,957,559
2,957,560
How do I check to see if a resource exists in Android
<p>Is there a built in way to check to see if a resource exists or am I left doing something like this.</p> <pre><code> boolean result; try { int test = mContext.getResources().getIdentifier("my_resource_name", "drawable", mContext.getPackageName()); if (test != 0) result = true; } finally { result = false; } </code></pre> <p>Also, do I even need the try/finally?</p>
java android
[1, 4]
571,256
571,257
Should I use Request.UrlReferrer when determining referrals
<p>I came upon an interesting discussion with my team around the use of HttpRequest.UrlReferrer and wanted to solicit feedback from the community. According to the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.36" rel="nofollow">W3C spec</a>:</p> <blockquote> <p>The Referer[sic] request-header field allows the client to specify, for the server's benefit, the address (URI) of the resource from which the Request-URI was obtained (the "referrer", although the header field is misspelled.) The Referer request-header allows a server to generate lists of back-links to resources for interest, logging, optimized caching, etc. It also allows obsolete or mistyped links to be traced for maintenance. The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI, such as input from the user keyboard.as input from the user keyboard.</p> </blockquote> <p>The Request.UrlReferrer object does the work of converting referral strings that contain well formed URIs to an object with properties on every request. </p> <p>According to our logs there are requests that come in that contain invalid data in the referral such as:</p> <pre><code>localhost app:/BeamBackTest.swf app:/multtiple.swf app:/AFriendFeed.swf ALToolBar app:/index.html mhtml:file://C:\Documents+and+Settings\User\Desktop\oracle\What+is+a+View+in+Oracle+-+Stack+Overflow.mht </code></pre> <p>Using Request.UrlReferrer would mean the above cases would be NULL. Is it better to discard the invalid data based on the W3C spec by using Request.UrlReferrer or preserve it by using Request.ServerVariables["HTTP_REFERER"] even though the data may be interesting, but potentially useless. </p>
c# asp.net
[0, 9]
3,216,257
3,216,258
accessing php array in js using json_encode
<p>I am using php and JS in my code.My requirement is I need to fetch the value from my-sql database and display into drop down list dynamically.I am populating the dropdown with JS but fetching the value with php(a usual thing). So the problem I am facing is once I get the value from php code and encode it using json_encode to access that array in JS it shows me value like [object Object].</p> <p>Please help.. Thanks.</p> <p>Sample Code:-</p> <pre><code>&lt;?php $result=mysql_query("select Location from servicelist")or die (mysql_error()); while($row = mysql_fetch_array($result)) $output[]=$row; $row=mysql_fetch_assoc($result); $output[]=$row; ?&gt; &lt;script language="javascript"&gt; function addOption_list(selectbox){ &lt;?php echo 'var month='.json_encode($output);?&gt; for (var i=0; i &lt; month.length;++i){ addOption(document.drop_list.AreaList, month[i], month[i]); //Once the value of the area will get selected we will call sub area based //on the area selected from the db } addSubAreaList(); } </code></pre>
php javascript
[2, 3]
5,387,917
5,387,918
Using list of serialized objects
<p>I'm learning Android/Java programming, but I'm confused about persistant data. After a lot of research it seems that the best way to store objects is to serialize them in a file, but I couldn't find a simple way to retrieve these objects.</p> <p>If I create two objects and save their serialized versions, how can I retieve and list both of them? Do I need to create a file for each object with a specific ID in the filename so I can list them with a <code>getFilesDir</code>?</p>
java android
[1, 4]
2,587,180
2,587,181
Numeric textbox control from radiobuttonlist selection
<p>I've a radiobutton list like this;</p> <pre><code> &lt;asp:RadioButtonList ID="RadioButtonFirm" runat="server" RepeatDirection="Horizontal"&gt; &lt;asp:ListItem id="option1" runat="server" Value="Firm Code" /&gt; &lt;asp:ListItem id="option2" runat="server" Value="Firm Name" /&gt; &lt;/asp:RadioButtonList&gt; </code></pre> <p>and also an asp:button control</p> <pre><code>&lt;asp:Button ID="btnSearchFirm" runat="server" OnClientClick="Validate();" Text="search" OnClick="btnSearchFirm_Click" /&gt; </code></pre> <p>and a textbox</p> <pre><code> &lt;asp:TextBox ID="txtCriteria" Width="120px" runat="server"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>If I select Firm Code from radio button, user only select numeric value to txtCriteria textbox, else string can be entered. How to validate it?</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
5,142,910
5,142,911
How do I select elements based on all their content in jQuery?
<p>I have a series of <code>&lt;div/&gt;</code>'s as follows:</p> <pre><code>&lt;div&gt;.co.uk&lt;/div&gt; &lt;div&gt;.com&lt;/div&gt; &lt;div&gt;.gb.com&lt;/div&gt; &lt;div&gt;.uk.com&lt;/div&gt; &lt;div&gt;.net&lt;/div&gt; </code></pre> <p>How do I select just the divs containing <code>.co.uk</code>, <code>.com</code>, <code>.net</code>.</p> <p>If I use:</p> <pre><code>$('div:contains(".co.uk"), div:contains(".com"), div:contains(".net")`) </code></pre> <p>This causes the <code>.gb.com</code> and <code>.uk.com</code> divs to be selected as well.</p>
javascript jquery
[3, 5]
1,129,667
1,129,668
loading content from php file with jQuery
<p>The following code fetch all data (by clicking a.info link) from a php file "info.php" and prints in the #content div. The problem is that it prints everything from info.php file. Can I possibly select only some part of data from info.php file to load in #content? The reason to ask this question is that, I want to load different data from the same php file for the different links. </p> <pre><code>$("a.info").click(function(){ var id=$(this).attr("id"); $("#box").slideDown("slow"); $.ajax({ type: "POST", data: "id="+$(this).attr("id"), url: "info.php", success: function(html){ $("#content").html(html); } }); }); </code></pre> <p><strong>Html where content is loading:</strong></p> <pre><code> &lt;div id="box"&gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>info.php</strong></p> <pre><code>paragraph1. paragraph2. </code></pre> <p>For example, In the above info.php file, i only want to load paragraph1 in the #content.<br> I hope my question is clear. Any help will be appreciated.</p>
javascript jquery
[3, 5]
3,450,942
3,450,943
Targeting plain text with jQuery
<p>I'm trying to isolate (and then manipulate) quote block formatted in common newsreader and email-client manner.</p> <p>The HTML:</p> <pre><code>&lt;p&gt; Hello there! &lt;br /&gt; I'm great, how are you? &lt;br /&gt; &lt;br /&gt; Someone wrote: &lt;br /&gt; &gt; Greetings, &lt;br /&gt; &gt; How are you? &lt;/p&gt; </code></pre> <p>I need to target all the lines that start with >, and hide them as a collapsable block. In the above example everything bellow "Someone wrote:" would then be hidden, saved as a variable and the end result produced by JS would be:</p> <pre><code>&lt;p&gt; Hello there! &lt;br /&gt; I'm great, how are you? &lt;br /&gt; &lt;br /&gt; Someone wrote: &lt;br /&gt; &lt;a href="#"&gt;Click to expand&lt;/a&gt; &lt;/p&gt; </code></pre> <p>Gmail does the same thing, but it serverside wraps the quotation block in a <code>&lt;div&gt;</code>, due to the specific nature of my project the complete process has to be done by JS alone. I'm working with the jQuery framework.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
2,465,004
2,465,005
How does one get to this stage:
<p>Hey guys reading some of the posts I came to realise something:</p> <p><a href="http://stackoverflow.com/questions/1718037/abuse-of-c-lambda-expressions-or-syntax-brilliance">Abuse of C# lambda expressions or Syntax brilliance?</a></p> <p>Why is it that atm im learning how to implement operations but I have no bearing on the foundations its made of.</p> <p>I can write a program to do a specific task but I dont know where its taking it from... kind of hard to explain what I mean but I dont understand what the system is doing for me. If that makes sense.</p> <p>When will I get to the stage I truley understand C or any code? How can I get to that stage?</p>
c# php javascript asp.net c++
[0, 2, 3, 9, 6]
1,390,966
1,390,967
Android: Dialog triggered onResume
<p>I am experiencing a weird behavior in my app.</p> <p>I have an Activity with a ListView. When you click on an item in the ListView, a TimePickerDialog is shown.</p> <p>If I hit the home button after closing the dialog, and then reload the app, the TimePickerDialog is shown automatically again.</p> <p>Now, I don't know why this behavior happens. I have logged messages at different points in the app to try to determine how it is triggered but to no avail.</p> <p>I even added this line:</p> <pre><code>Log.d("TEST", "TEST"); </code></pre> <p>inside the constructor of the TimePickerFragment and it is not getting fired! Yet the dialog is showing up!</p> <p>What is going on here?</p>
java android
[1, 4]
5,942,385
5,942,386
Bind html Atrribute Doesn't work
<p>first example works. second fails misrebly why?</p> <pre><code>(I except ErrorMessage="&lt;%# Model.StringProvider.GetString("Login.UserNameRequired.ErrorMessage")%&gt;") </code></pre> <p>to put the callled string in ErrorMessage this doesn't happen.</p> <pre><code>&lt;asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName"&gt;&lt;%= Model.StringProvider.GetString("Login.UserNameLabel")%&gt;&lt;/asp:Label&gt; &lt;asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="&lt;%# Model.StringProvider.GetString("Login.UserNameRequired.ErrorMessage")%&gt;" ToolTip='&lt;%= Model.StringProvider.GetString("Login.UserNameRequired.ToolTip")%&gt;.' ValidationGroup="Login1"&gt; &lt;/asp:RequiredFieldValidator&gt; </code></pre> <p>both '' and "" don't work</p>
c# asp.net
[0, 9]
5,452,938
5,452,939
Should I continue learning a language if in the meanwhile I became interested in another language/platform?
<p>I started learning Java a couple of months ago. I also wanted to become more exposed to linux so I installed ubuntu and started working with Java since then. In the meanwhile however I became more interested in C# and in learning the Windows platform. At this point I'm asking myself if I should stop learning Java and move to the .NET world. I don't hate or dislike Java by the way, I am just more curious about windows/.NET at this point in time. </p> <p>My question is, should I remain with Java or go with C#/.NET? What is your advice? </p>
java c#
[1, 0]
5,766,843
5,766,844
JQuery - how to stop a function?
<p>I have this code</p> <pre><code>&lt;script type="text/javascript"&gt; function test(counter) { if(counter==4) { counter=0; } if(counter==0) { //various stuff } counter = counter + 1; setTimeout(function () { test(counter); }, 7000); } $(document).ready(function () { test(0); }); &lt;/script&gt; </code></pre> <p>So when the page loads the <code>test(0)</code> function is running.</p> <p>But i have this link <code>&lt;a onclick="test(1)" rel="2" href="#"&gt;</code> that calls the same function again, having as a result to have the same function running twice.</p> <p>Is there a way to stop the function that is already running and then start the new one??</p>
javascript jquery
[3, 5]
1,438,525
1,438,526
Is there any way to include contents of a file inside of another with javascript?
<p>My code looks like this:</p> <pre><code>function submitHandler($link, $modal, close) { var ... var onDone = function (json, textStatus, XMLHttpRequest) { ... } var onFail = function (XMLHttpRequest, textStatus, errorThrown) { ... } var successModal = function (json) { ... } var failModal = function (json) { ... } if (!$form.get(0).checkValidity || $form.get(0).checkValidity()) { ... $.ajax({ .... .done(onDone) .fail(onFail); } } </code></pre> <p>All my related functions are together in the same file. I previously had the functions in different files but then I found out that it seemed better if they were in one file so they could share the same variables (at the top of the file). Is this the coding practice most people use or do they put each javascript function in its own file? Is there any way to include contents of a file inside of another ?</p>
javascript jquery
[3, 5]
4,466,194
4,466,195
Jquery post multiple vars to php
<p>I want to post multiple vars from jquery to php</p> <pre><code>&lt;script&gt; //vote script function vote(type){ $.post('vote.php', '{user_id: &lt;?php echo $fb_userid;?&gt;, page_name: &lt;?php echo $get_image;?&gt;, type: type}', function(data){ $('#voteNumber').html(data); }); }//end function &lt;/script&gt; </code></pre> <p>The above code is not working what is my problem ?</p> <p>here is my php</p> <pre><code>if(isset($_POST['user_id']) &amp;&amp; isset($_POST['page_name']) &amp;&amp; isset($_POST['type'])){ echo "done"; } </code></pre>
php javascript jquery
[2, 3, 5]
5,803,537
5,803,538
page transitions with jquery and php
<p>I'm using php to develop an application, and I'm using something like this to change the pages</p> <pre><code>&lt;?php if (!isset($_GET["p"])){ $p = 'home'; } else{ $p = $_GET["p"]; } include "$p.php"; ?&gt; </code></pre> <p>What I want to know is if there is a way to put some effects with JQuery when I change the page </p> <p>Something like a loading icon or anything that makes the browser not to display that white page when going from a page to another, can you understand what I want? </p> <p>At first I was using hidden <code>divs</code> and show/hide, but that usually made the JQuery effects within this <code>divs</code> get all messed up, so i changed to <code>php include</code>. </p> <p>What I need is that people won't feel like leaving on page to reach another, I want them to feel like they're just changing the contents .</p>
php javascript jquery
[2, 3, 5]
5,634,902
5,634,903
jQuery shorthand
<p>Is there any more elegant way to write that? :</p> <pre><code>var AllOperation = $('#menu &gt; li.operation'); var Operation1= AllOperation[0]; $(Operation1).addClass('operation-first'); </code></pre>
javascript jquery
[3, 5]
4,046,802
4,046,803
jquery next button focus
<p>To improve navigation on one of the pages I am tyring to set a focus on a next available(enabled) button when leaving last data entry field. </p> <pre><code>$('input[type=text], select, textarea').filter(':last').blur(function() { $('input[type=submit][type=button]:enabled:first').focus(); }); </code></pre> <p>For some reason it only works when last data entry field is textbox. Something is wrong in the handler.</p>
asp.net jquery
[9, 5]
885,784
885,785
How can I wait for an iframe to reload its contents?
<p>I have an HTML page that uses javascript / jquery to reload the contents of an iframe:</p> <pre><code> $('#my-frame').attr("src","someotherpageinthesamedomain"); </code></pre> <p>What I'd like to happen is to be able to manipulate the HTML of the iframe after it reloads. I tried this:</p> <pre><code> $("#my-frame").load(dostuff()); </code></pre> <p>But that does not wait for the reload -- I'm guessing because the iframe is already loaded with its original content.</p>
javascript jquery
[3, 5]
157,862
157,863
Need some help on jQuery sliding box script to set the height equal to text
<p>I have updated the code I am working on here <a href="http://jsfiddle.net/dFfJm/" rel="nofollow">http://jsfiddle.net/dFfJm/</a></p> <p>At the first sliding box where there is only 1 line of text. On the second box there are 3 lines of texts.</p> <p>As you can see it does not look right, there is a large empty sliding area in box 1. </p> <p>My question is how to keep it showing one row by default and when the user hovers the sliding part will be as high as the title length?</p> <p>Thank you. </p>
javascript jquery
[3, 5]
2,598,086
2,598,087
SlideToggle Div Animation
<p>i have the following jQuery code.</p> <pre><code>$(function() { $('.clickme').click(function() { $('.totalthing').slideToggle('slow','easeInOutQuart', function() { // Animation complete. }); $('.expandedcase').slideToggle('slow','easeInOutQuart', function() { // Animation complete. }); }); }); </code></pre> <p>At the moment it closes one of the div's and opens another at the same time. What I want it to do is close the open div then once it is fully closed it opens the other.</p>
javascript jquery
[3, 5]
2,591,714
2,591,715
Jquery child elements
<p>When I add event handler to a some elements using query:</p> <pre><code>$('div').mouseover(function () { }); </code></pre> <p>Iinside function I have an element for which we add event function ($(this)). how can I check inside this function next:</p> <ol> <li>Have this "DIV"($(this)) child elements "DIV"? </li> <li>Have this "DIV"($(this)) child element "DIV" whith height more than 300?</li> </ol>
javascript jquery
[3, 5]
2,821,707
2,821,708
jQuery get index of certain child elements and ignore others
<p>I'm trying to get the index of a child element <code>ol</code>, but there is also some <code>h2</code>'s in there which I don't need and are therefore polluting my results when using the jQuery <code>index()</code> function.</p> <p>So I need the index of the <code>ol</code>, as if there weren't any <code>h2</code>'s at all. So that if you click on the 3rd <code>ol</code> the index will be <code>2</code> and not <code>4</code>.</p> <p>The HTML looks like this:</p> <pre><code>&lt;div&gt; &lt;h2&gt;Title&lt;/h2&gt; &lt;ol&gt;&lt;li&gt;Item&lt;/li&gt;&lt;li&gt;Item&lt;/li&gt;&lt;li&gt;Item&lt;/li&gt;&lt;/ol&gt; &lt;h2&gt;Title&lt;/h2&gt; &lt;ol&gt;&lt;li&gt;Item&lt;/li&gt;&lt;li&gt;Item&lt;/li&gt;&lt;li&gt;Item&lt;/li&gt;&lt;/ol&gt; &lt;h2&gt;Title&lt;/h2&gt; &lt;ol&gt;&lt;li&gt;Item&lt;/li&gt;&lt;li&gt;Item&lt;/li&gt;&lt;li&gt;Item&lt;/li&gt;&lt;/ol&gt; &lt;h2&gt;Title&lt;/h2&gt; &lt;ol&gt;&lt;li&gt;Item&lt;/li&gt;&lt;li&gt;Item&lt;/li&gt;&lt;li&gt;Item&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt; </code></pre> <p>And the jQuery:</p> <pre><code>$('ol li').click(function () { // get current index position of the ol var itemIndex = $(this).parent('ol').index(); alert(itemIndex); }); </code></pre>
javascript jquery
[3, 5]
54,387
54,388
window.scrollTo weirdness inside Android webview
<p>I'm having a weird issue when I use window.scrollTo(0, document.body.scrollHeight) to scroll to the bottom of a page (loaded inside an Android webview). There's a huge gap of whitespace at the bottom of the page (it disappears when the page is tapped). Does anyone have any advice? Thanks.</p> <p><img src="http://i.stack.imgur.com/nG5W3.png" alt="enter image description here"></p>
javascript android
[3, 4]
5,011,308
5,011,309
How to make .jar library from sources
<p>I have Tapjoy sources sources, which have such sructure: <code>Tapjoy/src/com/tapjoy/*.class</code></p> <p>It must be compiled with Android API Level 9 and higher. My project is in version Android API Level 8.</p> <p>So I need to make from sources of <code>Tapjoy -&gt; tapjoy.jar</code> file and include it to my main project.</p> <p>How can I make <code>.jar</code> file properly with command line or from eclipse?</p>
java android
[1, 4]
2,336,152
2,336,153
How to read text from a textbox and make some of them a link?
<p>I will show the problem with a example.</p> <p>There is some text in the textbox such here:</p> <p>Hi! this is a example [lnk]text[/lnk]</p> <p>When i push the submit button and publish this text, the word in the [lnk] and [/lnk] tags must be a link like this www.mysite.com?link=text. </p> <p>How do I make it easily with javascript or jquery?</p> <p>Note: I'm not so good about javascript.</p>
asp.net javascript jquery
[9, 3, 5]
2,453,736
2,453,737
Link using Javascript to show content dynamically without refreshing
<p>I want to put some links in my web page. I am using php for developing my webpage When user click any one of it, the content corresponding to that link will show just below it without refreshing the whole page I know it a simple basic, but I dont know javascript much to work with... Can anyone please help me...</p> <pre><code>link1 link2 link3 link4 link5 content...... ................... ................... ................... </code></pre> <p>when clicks link1 it will show a set of content, or if link2 then with another set of content and so on... without refreshing the page</p>
php javascript
[2, 3]
1,026,615
1,026,616
DataTable in JavaScript
<p>I want to create table of data in JavaScript equivalent to this code in c#: </p> <pre><code>// Create DataTable to store the mobiles in it DataTable dTable = new DataTable("mobiles"); DataTable dTable_Int = new DataTable("mobilesInt"); DataTable dTable_STC = new DataTable("mobilesSTC"); DataTable dTable_MobilyZain = new DataTable("mobilesMobilyZain"); DataColumn fMobileColumn = new DataColumn(); DataColumn fMobileColumnSTC = new DataColumn(); DataColumn fMobileColumnMobilyZain = new DataColumn(); DataColumn fMobileColumnInt = new DataColumn();` </code></pre> <p>other meaning what is the code equivalent to it in JavaScript?? thanks.</p>
c# javascript
[0, 3]
2,493,309
2,493,310
Insert } to Complete ClassBody error even with matched braces
<p>Yes. I know this is trivial. But this is getting silly. </p> <p>Image proving the error:</p> <p><img src="http://i.stack.imgur.com/BXMUG.png" alt="enter image description here"></p> <p>The code:</p> <pre><code>package apack.age; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; public class DisplayContactActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.display_contact_layout); } public void openSubreddit(View view) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.reddit.com"))); } public void openTwitter(View view) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://twitter.com"))); } public void openGmail(View view) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("www.gmail.com"))); } } </code></pre> <p>Seriously. There's 5 open and 5 close braces. This is my first attempt at an android app but I have 3 years of Java experience so this is pretty frustrating.</p> <p>Run errors out. Refresh does nothing. Project clean does nothing. Auto code format in eclipse (CTRL + SHIFT + F) does nothing.</p> <p>EDIT 1: Copying the code to a new class gets it to compile. I'm running the new version of Eclipse: Juno. I've done source -> cleanup and it just says "nothing to change" every time!</p>
java android
[1, 4]
5,347,950
5,347,951
Disable a jqueryui datepicker
<p>I have a jqueryui datepicker associated with a input text. When i make the input textbox readonly i dont want the datepicker to show up . Is that possible? I would be setting the readonly property to true or false from the code.</p> <pre><code>&lt;script&gt; $(function() { $( "#datepicker" ).datepicker(); }); &lt;/script&gt; &lt;div class="demo"&gt; &lt;p&gt;Date: &lt;input type="text" id="CompleteDate"&gt; &lt;input class="change" type="checkbox" name="chkBoxb" id="chkBoxb"&gt; &lt;/p&gt; &lt;/div&gt; j$('#chkBoxb').click(function(){ var paramChangeBoxes = j$('input:checkbox.change'); if (j$(this).is(':checked')) { paramChangeBoxes.removeAttr('checked'); j$('#chkBoxb').attr('checked', 'checked'); j$('#CompleteDate').attr('readonly',false); j$("#CompleteDate").datepicker(); } else { j$('#CompleteDate').attr('readonly',true); $( "#CompleteDate:not([readonly])" ).datepicker(); } }); </code></pre> <p>Updated the code</p>
javascript jquery
[3, 5]
2,755,402
2,755,403
Add asp:TableRows to asp:Table after load in the background
<p>I'm trying to add rows to an ASP table control in a seperate thread. Basically this is what I have so far:</p> <p>Codebehind:</p> <pre><code> protected void onLoad(object sender, EventArgs e) { Thread obj = new Thread(new ThreadStart(testX)); obj.IsBackground = true; obj.Start(); } void testX() { System.Threading.Thread.Sleep(5000); Table tblOnline = (Table)FindControl("test"); TableRow r = new TableRow(); TableCell c1 = new TableCell(); Label test = new Label(); test.ForeColor = System.Drawing.Color.Black; test.Font.Bold = true; test.Text = "Rank"; c1.Controls.Add(test); r.Cells.Add(c1); tblOnline.Rows.Add(r); } </code></pre> <p>My ASPX:</p> <pre><code>&lt;body&gt; &lt;asp:Table runat="server" id="test"&gt;&lt;/asp:Table&gt; &lt;/body&gt; </code></pre> <p>When I compile the website, I don't see any row added to the table after 5 seconds. Is this not possible or am I missing something?</p>
c# asp.net
[0, 9]
1,776,438
1,776,439
LinkButton Designing with Javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/14655275/managing-linkbutton-with-javascript">Managing LinkButton with Javascript?</a> </p> </blockquote> <p>I want to put LinkButton on MultiView control on Webform by manipulating function of LinkButton.LinkButton called "Exit Chat",when I click this button I need to see OK-Cancel dialog and when I select OK button,everything should be disappered on the MultiView.</p> <p>How can I do this?(by using HTML and Javascript on Webform controls)</p> <p>I tried to write javascript:confirm("*"); When I write this code I couldnt control OK-Cancel dialog screen :(</p>
javascript asp.net
[3, 9]
2,411,365
2,411,366
Javascript to fix iframe height according to available height in the browser window
<p>I need Javascript to fix the iframe height dynamically according to available height in the browser ?</p>
javascript jquery
[3, 5]
3,558,056
3,558,057
Weird issue on IE (IE9 and lower) with JavaScript (jQuery)
<p>I am experiencing a weird problem on IE (IE 9 and lower).</p> <p>I have a form having a select and a radio. When anyone changes anything in the select or radio, it calculates the total price.</p> <p>Here is the code: <a href="http://jsfiddle.net/Debiprasad/DLQ82/8/" rel="nofollow">http://jsfiddle.net/Debiprasad/DLQ82/8/</a></p> <p>It works fine in all browsers. But when I am testing this on IE: When I am changing the select value, then it works fine. But when I am changing the value radio, then it does not work.</p> <p>The weird part is, if I added an alert to any of the functions, which executed when the value of radio changes, then it works fine on IE. What could be the problem and how to fix this?</p>
javascript jquery
[3, 5]
5,266,683
5,266,684
How to display html content using Javascript or jQuery?
<p>Currently I use iFrame to display third party content. For example, my news page displays live website from CNN, MSNBC, Foxnews in single page. </p> <p>Currently, I am just using iFrame to display those sites, but I was wondering if there is a better way to display the contents using Javascript, jQuery or other type of Javascript library?</p> <p>Thanks</p> <p>[edit] Is there a way I can compress the iframe and display it <strong>as</strong> a thumbnails without converting it to an image. Just shrink everything. </p>
javascript jquery
[3, 5]
4,830,971
4,830,972
Selecting by ID attribute using JQuery in ASP.NET
<p>I've just started using JQuery in VS 2008, and so far I like it! But, I'm confused about how I should be using JQuery in order to select asp.net controls on a webpage.</p> <p>For example, I have the following code (just a mock-up):</p> <pre><code>&lt;asp:textbox id="txtSomeData1" runat="server" text="Some Data!!"&gt;&lt;/textbox&gt; </code></pre> <p>Now, if I want to use JQuery to select the textbox and change it's text to "Some More Data!!", then I would have to do something like:</p> <pre><code>$('input#ctl00_ContentPlaceHolder1_txtSomeData1').val('Some More Data!!'); </code></pre> <p>Which, quite frankly, is annoying because I don't want to mess with having to figure out what the id of the control is after it's rendered to the webpage (ctl00_ContextPlaceHolder... blah blah blah).</p> <p>Is there a way that I can select the textbox without having to use the id of it? Also, I know that you can select by class name, but that doesn't help much if the control that you're selecting doesn't have a class. </p> <p>Am I just missing something here?</p> <p><strong>JUST TO REITERATE: I do not want to use a class to select the input tag!! I would like to use the id "txtSomeData1" and not the long id that is rendered to the webpage.</strong></p>
asp.net jquery
[9, 5]
4,788,639
4,788,640
how can i change selected value of drop list dynamically
<p>i want to pick the value from text box and then change the value of dropdown list according to that value </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script&gt; function change() { var value = document.getElementById('text').value; document.getElementById("Model").selectedvalue = value } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;asp:DropDownList ID="Model" AutoPostBack="false" runat="server" CssClass="styled"&gt; &lt;asp:ListItem Value="None"&gt;None&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Enum"&gt;Enum&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Sum"&gt;Sum&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Multi"&gt;Multi&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Xaxis"&gt;Xaxis&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;input id="text" type="text"/&gt; &lt;input type="button" onclick="change();"/&gt; &lt;/body&gt; &lt;html&gt; </code></pre>
javascript asp.net
[3, 9]
3,937,373
3,937,374
QueryString containing \ coming through with \\
<p>I'm have a page which I sent a parameter through the query string.</p> <p>If I'm retrieving it with Request.QueryString["Format"] I'm having troubles with the type 'CD\DVD'. It's being returned as 'CD\\DVD'. It's important I get this as the right string.</p> <p>How do I avoid the extra backslash? Or even get rid of it later?</p>
c# asp.net
[0, 9]
3,532,538
3,532,539
Is element before or after another element in DOM
<p>Is there a means of detecting whether an element appears before or after another element in markup? This is <em>regardless</em> of position in DOM. It could be a child, a sibling, a parent or a parent's parent. This is a general question, so no markup to share.</p> <p>To clarify - this is in regards to the element's position in markup, not its display position. Now that I think about it my question is a bit strange because if you have element X and element Y then you can have these scenarios.</p> <pre><code>//in regards to y &lt;x /&gt; &lt;y /&gt; //:after &lt;y /&gt; //:before &lt;x /&gt; &lt;x&gt;&lt;y /&gt;&lt;/x&gt; //not really before or after is it? </code></pre>
javascript jquery
[3, 5]
1,821,394
1,821,395
Is there a JavaScript (or jQuery) shortcut for "function(){return false;}"?
<p>To prevent actions from happening, I frequently type </p> <pre><code>function(){return false;} </code></pre> <p>Is there a shortcut?</p>
javascript jquery
[3, 5]
4,217,446
4,217,447
JQuery Hover does not work Mozilla
<p>I have the following Snippet of code.The hover has a problem in Mozilla - It changes color on hover but some times it does not revert back when we go out.Mind you it only happens sometimes.Also in such cases if I examine the HTML using FireBug I can see that the Extra Class is assigned even after hover is out.It works OK on IE .This is a simplified version</p> <p>Also as you can see I am setting color on the TR.But this does not change the Color on TextBoxes inside TR. How can I make sure the background color of the Controls contained in the TR is also changed on hover.</p> <pre><code> &lt;style type="text/css"&gt; .HighLight { background-color:Fuchsia; } .Select { border:soild 2px Blue; margin:3px; } &lt;/style&gt; &lt;script type="text/javascript" src="jquery-1.4.2.js"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $(".Select").hover( function() { $(this).addClass("HighLight"); }, function() { $(this).removeClass("HighLight"); }); }); </code></pre> <p>My Markup generated by ASP.NET Repeater Control is a table with TR assigned Class Select.</p> <pre><code>&lt;tr class="Select" &gt; &lt;td&gt; &lt;input type="checkbox" id="chkSelect" /&gt; &lt;/td&gt; &lt;td&gt; &lt;input name="Repeater1$ctl11$tb" type="text" value="Sharp Bikes" id="Repeater1_ctl11_tb" /&gt; &lt;/td&gt; &lt;td&gt; &lt;input name="Repeater1$ctl11$tb2" type="text" value="10/13/2004 11:15:07 AM" id="Repeater1_ctl11_tb2" /&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre>
asp.net jquery
[9, 5]
5,965,516
5,965,517
FilterExpression problem - multiple conditions
<p>I have an asp.net c# website I'm developing with Visual Web Developer Express Edition 2010. In this website I have a FilterExpression that should filter three criteria: a start date, end date, and keyword search. </p> <p>I am able to get the start and end date filter working by itself, and also the keyword search is working by itself. What I'm having trouble with is getting all three to work together. </p> <p>The code I'm using (below) displays all records by default (good) and does the following when trying to filter:</p> <ul> <li>search keyword: all records</li> <li>search keyword plus date range: no records</li> <li>just date range: all records</li> </ul> <p>Here's the code I have now, which tries to integrate all three but does not work. Any advice would be helpful:</p> <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:sermonConnectionString %&gt;" SelectCommand="SELECT ID, sermon_date, sermon_speakerfirst + ' ' + sermon_speakerlast AS Speaker, sermon_title, sermon_subtitle, sermon_notes FROM what ORDER BY sermon_date DESC" FilterExpression="([sermon_title] LIKE '%{0}%') AND ([sermon_date] &gt;= '{1}' AND [sermon_date] &lt;= '{2}')"&gt; &lt;FilterParameters&gt; &lt;asp:ControlParameter ControlID="TextBox2" PropertyName="Text" Type="DateTime" ConvertEmptyStringToNull="true" /&gt; &lt;asp:ControlParameter ControlID="TextBox3" PropertyName="Text" Type="DateTime" ConvertEmptyStringToNull="true"/&gt; &lt;asp:ControlParameter ControlID="SermonSearch" PropertyName="Text" Type="String"/&gt; &lt;/FilterParameters&gt; &lt;/asp:SqlDataSource&gt; </code></pre>
c# asp.net
[0, 9]
2,708,673
2,708,674
jQuery Ajax form only sends last of several checkbox values
<p>I'm trying to submit a form with jQuery's $.ajax() function and it works, aside from the fact that it only sends the value of the last of several checkboxes, regardless of how many I check. I'd appreciate if someone could tell me what I'm doing wrong. Thanks in advance!</p> <p>The HTML form:</p> <pre><code>&lt;form name="contactFormSmall" id="contactFormSmall" action="" method="post"&gt; &lt;input type="text" name="textfieldname" value="textfieldvalue" /&gt; &lt;input type="checkbox" name="checkboxes" value="Testvalue One" checked="checked" /&gt; &lt;input type="checkbox" name="checkboxes" value="Testvalue Two" checked="checked" /&gt; &lt;input type="checkbox" name="checkboxes" value="Testvalue Three" checked="checked" /&gt; &lt;/form&gt; </code></pre> <p>Here's the jQuery handling the form:</p> <pre><code>var fields = $(":input").serializeArray(); $.ajax({ type: "POST", contentType: "application/x-www-form-urlencoded;charset=ISO-8859-15", url: "includes/contact_process_small.php", data: fields, success: function(data) { $('#contactFormSmall').hide(); $("#formFeedback").html(data).show(); } }); </code></pre> <p>And here's the result from print_r($_POST) in the php script:</p> <pre><code>Array ( [textfieldname] =&gt; textfieldvalue [checkboxes] =&gt; Testvalue Three ) </code></pre>
php javascript jquery
[2, 3, 5]
2,477,105
2,477,106
Javascript: Find out which element was clicked without attaching any eventlistener to it?
<p>I am confused on finding an approach to resolve this issue. Consider below html</p> <pre><code>&lt;body&gt; &lt;div id="parent" onclick="myFunc"&gt; &lt;div id="child-a"&gt;&lt;/div&gt; &lt;div id="child-b"&gt;&lt;/div&gt; &lt;div id="child-c"&gt;&lt;/div&gt; &lt;div id="child-d"&gt;&lt;/div&gt; &lt;div id="child-e"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>Event listener is attached to the parent element. If a user clicks on lets say 'child-c', is there any way to find out using "myFunc" that which div was clicked? In this case 'child-c'. Any possible solution using pure JS or jQuery?</p> <p>Let me know if more explanation is required. Thank you for helping.</p> <p>-Nishant</p>
javascript jquery
[3, 5]
4,087,256
4,087,257
Easy modification on a jQuery url
<p>In the following url I want to include also <code>&amp;id=&lt;?php echo $id; ?&gt;</code> How can I do it?</p> <p><code>url: "loadmore.php?lastid=" + $(".postitem:last").attr("id"),</code></p>
javascript jquery
[3, 5]