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
5,562,683
5,562,684
How to change jQuery datepicker options in codebehind
<p>I am creating a user control that uses the jQuery date picker widget, as follows:</p> <pre><code>$(function () { $("#datePickerYearMonth").datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-M-yy', }); }); </code></pre> <p>But instead of hard coding the options I would like to create properties or something like that so that I can change the properties dynamically from code behind.</p> <p>Is this possible?</p>
c# jquery asp.net
[0, 5, 9]
5,810,773
5,810,774
XML Serialization and null value - C#
<p>I have an object that I serialize to XML. If one of the properties in the object is null, then native serialization ignores to add this as the attribute. Is this normal behavior, if so, is there a way I can override it?</p> <p>ex:</p> <pre><code>public class Test { [XmlAttribute] public string value {set; get; } [XmlAttribute] public string key {set; get; } } </code></pre> <p>When value is null, i get</p> <pre><code>&lt;Root&gt; &lt;Test key="blah"&gt; &lt;/Root&gt; </code></pre>
c# asp.net
[0, 9]
3,701,882
3,701,883
Make Parent Attribute
<p>can someone help me with jquery. i have a html TAG like this</p> <p><code>&lt;p class="celak"&gt;hohohohoho&lt;/p&gt;</code></p> <p>and i want to make the output (give its parent) be like this</p> <p><code>&lt;div class="celak-parent"&gt;&lt;p class="celak"&gt;hohohohoho&lt;/p&gt;&lt;/div&gt;</code></p> <p>is there somebody know which jquery method can do that?</p> <p><code>$('.class').???</code></p> <p>sorry if my write not very good. this first time i asking here.</p>
javascript jquery
[3, 5]
3,019,158
3,019,159
Is there any standard defined for Javascript showModalDialog method?
<p>I am displaying data in GridView control (Visual Studio 2008). My client has asked to show a dialog once user clicks a cell but he has asked it as a <strong>modal</strong> window. This is to edit a cell. In-cell editing cannot be used because information to be collected is complex and would require lot of controls along with another GridView.</p> <p>After searching on net, I came to know that showModalDialog Javascript method (on Window object) would work - seems that it works in FF and IE and that's sufficient for me.</p> <p>Now my question : Is there any standard body (or recommendation) which defines Javascript Window object (and consequently its showModalDialog method)?</p> <p>I know Standard ECMA-262 ECMAScript Language Specification defines just core Javascript. When I looked at various standards (or recommendations) set by W3C - XHTML, DOM, etc. But I could not find any standard (or recommendation) for Window object.</p>
javascript asp.net
[3, 9]
2,330,802
2,330,803
Passing function with parameters as a parameter to a jQuery's callback
<p>I'm having some difficulties with passing functions around. I have this code:</p> <pre><code> var options = [ { name: "menu 1", func: function (element) { $(element).css("color", "Red"); } }, { name: "menu 2", func: function (element) { alert("menu 2"); } }, { name: "menu 3", func: function (element) { alert("menu 3"); } } ]; // This basically creates a div with ul, and li element for each object in options, // and attaches click event to each li that should fire provided func. (function menuMaker(options) { var menuDiv = $("&lt;div id='test' /&gt;"); var menuUl = $("&lt;ul&gt;"); menuDiv.append(menuUl); for (var i = 0; i &lt; options.length; i++) { var li = $("&lt;li&gt;" + options[i].name + "&lt;/li&gt;"); // **li.click(function () { options[i].func(menuDiv); });** //&gt;&gt; The line above gives "options[i] is undefined" error. Looks like a scoping issue. var userFunc = options[i].func; **li.click(function(){ userFunc(menuDiv);});** //&gt;&gt; The line above always fires the last function (alert("menu 3")) menuUl.append(li); } $(document.body).append(menuDiv); })(options); </code></pre> <p>and I'm getting those errors I've commented. Any ideas what am I doing wrong ?</p> <p>Thanks !</p>
javascript jquery
[3, 5]
2,093,836
2,093,837
$("#but0_0").attr(...) works but $(hid).attr(...) does not work when hid === "#but0_0"
<p>On Safari 4.0, I have a check that prints "????" if hid === "#but0_0"</p> <p>Works:</p> <pre><code>$("#but0_0").attr("onmousedown",function(){alert("Aha!");}); </code></pre> <p>Doesn't work:</p> <pre><code>var id = "but"+y+"_"+x; var hid = "#"+id; if (hid === "#but0_0") console.debug("????"); $(hid).attr("onmousedown",function(){alert("Aha!");}); </code></pre> <p>The console shows "????" so the code is getting hit and the variable is "the same" (from === string compare point of view) as the string literal but apparently jQuery's $() operator knows the difference?</p> <p>I have 30 divs to manipulate and I need to compute the id of the div at run time. Any ideas? It's probably something simple like pulling out a "string" from a "String" or some such <a href="http://lists.canonical.org/pipermail/kragen-tol/2005-May/000782.html" rel="nofollow">JavaScript stupidity</a>.</p>
javascript jquery
[3, 5]
4,798,433
4,798,434
Looking for a good datagrid plug-in for jQuery
<p>I have a requirement to let my users maintain some accounts and accommodations. Each account can 1 to many accommodations and each accommodation is link to only 1 account.</p> <p>I want to be able to let the users edit the account details. On the same page I would like to list the accommodations that are linked to that account and allow the user to link more accommodations to that account, double click on an accommodation to edit its details and to also be able to delink the accommodation.</p> <p>I thought that is really suited to having a datagrid for the accommodations as well as maybe a lookup field to add more accommodations to the datagrid. Can anyone recommend a jQuery datagrid?</p> <p>EDIT: Been looking around and found the following.</p> <ul> <li>jqGrid</li> <li>FlexiGrid</li> <li>ingrid</li> </ul> <p>so far my favourite looks like jqGrid</p>
asp.net jquery
[9, 5]
2,666,314
2,666,315
Distance of Lat & Long in android
<p>I have an doubt in java..hope i need a code for my application. Consider a taxi application, i want to get distance between two travelled places by taxi using latitude and longitutude..</p> <p>I saw some examples in stack overflow,it is not sufficient to do my application...</p> <p>Assume there are two buttons, start &amp; stop </p> <p>if i press start,it needs to start monitoring the distance if i press stop,it needs to stop monitoring the distance and calculate overall distance</p> <p>for example: i am starting from 'a' &amp; distance is 0000 i stopped in 'b' &amp; distance is 0364</p> <p>i want to get display like above mentioned in example I want in android pls suggest me to get results Results would be show as TextView..</p>
java android
[1, 4]
4,399,140
4,399,141
get the closest value from a list jquery
<p>i need to get the closest class html from my list, but its always returning null if i put directly the <code>closest</code>. i try some other thinks, but its not working.</p> <p>the <strong>html:</strong></p> <pre><code>&lt;ul id="ulId"&gt; &lt;li class='effectLeg'&gt; Stuffs &lt;/li&gt; &lt;li class='test legColor' style=''&gt;&lt;/li&gt; &lt;li class='effectLeg'&gt; Stuffs 2 &lt;/li&gt; &lt;li class='test legColor'&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>so, if i hover the last LI (for exp.) the hover will get the closest class <code>effectLeg</code> and give me the HTML or anything inside ( in that case the STUFFS 2 ).</p> <p>the <strong>js</strong>: </p> <pre><code>$(".legColor").live("hover", function(){ alert($(this).closest("#ulId").find(".effectLeg").html()); }); </code></pre> <p>the closest i get was using find, but the find only get the first value of my <code>li</code></p> <p>i made a exp: check the <a href="http://jsfiddle.net/eC5YE/7/" rel="nofollow"><strong>Demo</strong></a></p>
javascript jquery
[3, 5]
5,587,930
5,587,931
how to send json to php file to save on server
<p>Im developing a javascript/php/ajax application and have stumbled across some problems.</p> <p>Im confident at javascript and ajax but my php is a little rusty.</p> <p>My aim is to get a json file from the server, modify it using javascript, and then save this modified json back to the server.</p> <p>After some research it was obvious that the modified json file must be sent to a php file, this php file will then do the saving.</p> <p>HOW do i send a json string from javascript to php? OR how do I get the php file to pick up the json variable from the javascript?</p> <p>im assuming the php will be something like:</p> <pre><code>&lt;?php $json = $_POST["something"]; ?&gt; </code></pre> <p>but how do i send or "post" the javascript variable to the php file?</p> <p>I was thinking about creating a hidden html form, setting a hidden textbox to the json string, then posting the html form</p> <p>But surely there must be a way without including the html middle man?</p> <p>Im looking for answer WITHOUT jQuery. Seeing as this is an application i would like a relieve the dependancy of jQuery. </p>
php javascript
[2, 3]
1,799,390
1,799,391
JQuery match 2 IDs by post-delimiter number
<p>Trying to figure out a way to streamline a script. I have hundreds of icons each with the id "icon_#-#" where the first # relates to a set that particular icon belongs to, and the second # is unique to that icon within the set. Each relates to a box w/ id "box_#-#" where the #-# relates it to a specific icon. For example, #icon_1-1 relates to #box_1_1 and #icon_1-2 relates to #box_1-2. My code is as follows:</p> <pre><code> $('#icon_1-1').click(function(){ $('#box_1-1').fadeIn("500"); }); </code></pre> <p>Obviously, using this method I'd have hundreds of lines. Is there a way to streamline, something like:</p> <pre><code> $('#icon_[array 1-100]').click(function(){ $('#box_[array 1-100]').fadeIn("500); }); </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
3,165,298
3,165,299
How to become comfortable with javascript and its libraries(jQuery)?
<p>I am a php lover,working with php for last 2+ years also freelancing in different php producus like wordpress,joomla,drupal.I feel comfortable with php, I tried to learn javascript and its other libraries but feeling uncomfortable.Can not become productive also.</p> <p>So would any one give suggestion how i can learn the javascript?</p>
javascript jquery
[3, 5]
3,127,291
3,127,292
Lightbox and dynamic links - how and why does this work?
<p>I had a problem, was going to ask how to fix it, but then the answer popped up in a related question. Seeing I have little experience with jQuery, I would like to understand exactly "what" happens with what I'm doing.</p> <p>FYI: jQuery (latest) + jCarousel + Lightbox.</p> <p>jCarousel creates a few links for me, and Lightbox captures these links and shows a nice frame around the picture I linked.</p> <p>The code that did the trick was</p> <pre><code>$('a.gallery').live("click", function(e) { $(this).lightBox({ imageLoading : 'img/lightbox-ico-loading.gif', imageBtnClose : 'img/lightbox-btn-close.gif', imageBtnPrev : 'img/lightbox-btn-prev.gif', imageBtnNext : 'img/lightbox-btn-next.gif' }); $(this).triggerHandler('click'); e.preventDefault(); }); </code></pre> <p>..instead of</p> <pre><code>$('a.gallery').lightBox({ imageLoading : 'img/lightbox-ico-loading.gif', imageBtnClose : 'img/lightbox-btn-close.gif', imageBtnPrev : 'img/lightbox-btn-prev.gif', imageBtnNext : 'img/lightbox-btn-next.gif' }); </code></pre> <p>My question is; what is the exact difference between these?</p> <p>Thanks alot</p>
javascript jquery
[3, 5]
5,589,045
5,589,046
Getting jquery error like "not a function"?
<p>I'm getting a JavaScript error saying <code>$tabAcc.removeClass is not a function</code> when executing the code below. What could be the issue?</p> <pre><code>var $tabAcc = '', $tabtoShow = '', $tabSelectAcc = '', $tabtoShowSelected = '', $tabSelectAcc = '', $tabBilling = '', $tabtoShowBilling = '', $tabSelectBilling = '', $tabtoShowBillingSelected = ''; $(".tabAcc").mouseover(function () { $tabAcc = $(".tabAcc"); $tabtoShow = $tabAcc.children('.tabListMenu'); $tabAcc.removeClass('tabAcc').addClass('tabHoverAcc'); $tabtoShow.show(); }).mouseout(function () { $tabAcc.removeClass('tabHoverAcc').addClass('tabAcc'); $tabtoShow.hide(); }); </code></pre>
javascript jquery
[3, 5]
2,007,396
2,007,397
Get a hard coded jquery selector from an array and hide it?
<p>How would I get each hard coded selector from the array and hide it using the jQuery hide() method?</p> <pre><code>function hideAllExcept(except) { //Create an array to contain all of the sub navigation elements var sub_navigation = new Array(); //Get each sub ul element of the main ul and push it to the previously created array $('#navigation_sub ul').each(function(index, element) { sub_navigation.push('$("#' +this.id+'")'); }); var x = sub_navigation.length; for(var i = 0; i &lt; x; i++) { $(sub_navigation).each(function(index, element) { $(sub_navigation)[0].hide(); alert(element); alert(this); this.hide(); }) } } </code></pre>
javascript jquery
[3, 5]
716,985
716,986
Android: where to store data? Data base or xml?
<p>For example a have set of words. 1000 words. And on click i need to take one of these words and show to the user. User can't add words. </p> <p>Where is better to keep this set of words? First of all i had idea to store them in DB, but then i thought that is better to store them in xml file, and on application start get them all in List and use.</p> <p>Is it good way? Or it's better to use DB?</p>
java android
[1, 4]
1,681,107
1,681,108
Transversing the DOM in jQuery
<p>I have a bunch of these little bits of HTML code repeated over and over again:</p> <pre><code>&lt;div class="collapse" id="any_mins"&gt; &lt;fieldset&gt; &lt;legend&gt;&lt;img title="Click to expand" class="plus" alt="+" src="" /&gt;Heading&lt;/legend&gt; &lt;table class="mins_table"&gt; lots of rows and cells go here &lt;/table&gt; &lt;/fieldset&gt; &lt;/div&gt; </code></pre> <p>Inside the tables there are form elements, mainly textboxes and selects. I have a bit of jQuery that makes the <code>&lt;legend&gt;</code> heading highlighted if there are non-blank form elements in the containing table. It looks like this:</p> <pre><code>// input td tr tbody table legend img $("input[type='text'][value!=0]").parent().parent().parent().parent().show();//the table $("input[type='text'][value!=0]").parent().parent().parent().parent().siblings().children().attr("src", minus_path);//the image $("input[type='text'][value!=0]").parent().parent().parent().parent().siblings().addClass("highlighted")//the legend // option select td tr tbody table legend img $("option:selected[value!=0]").parent().parent().parent().parent().parent().show();//the table $("option:selected[value!=0]").parent().parent().parent().parent().parent().siblings().children().attr("src", minus_path);//the image $("option:selected[value!=0]").parent().parent().parent().parent().parent().siblings().addClass("highlighted") </code></pre> <p>This works, but is obviously the wrong way. Whats the right way?</p>
javascript jquery
[3, 5]
4,775,004
4,775,005
access jquery plugin from jquery template
<p>i'd like to access a jquery plugin from inside a template. This doesn't appear to work:</p> <pre><code>&lt;script id="myTemplate" type="text/x-jquery-tmpl"&gt; {{= $.myplugin.myFunction( data.datum) }} &lt;/script&gt; </code></pre> <p>i could pass in a function to the template like:</p> <pre><code>$('#myTemplate').tmpl(data, { myFunction: function (datum){ return datum +datum; } } </code></pre> <p>but this seems hacky.</p> <p>Is there a cleaner solution? Or am i miss calling the jquery plugin object?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
1,996,358
1,996,359
Get the name that a person logged on to the computer with
<p>I was wondering if it was possible to get the username of the person who had logged on to the computer in php or javascript. For example, if I get on my laptop, log in to the computer, and go to the website, I would want it to show the name I logged in with.</p> <p>Is there any way to do this, or is it impossible</p>
php javascript
[2, 3]
367,184
367,185
"aspnet_compiler.exe" exited with code 1" error when including ASP file
<p>I have a ASP.NET project and when building the project it is showing build suceessfull. But when I am building the deployment project, it is showing build failed with an error message </p> <pre><code>Error 5 "aspnet_compiler.exe" exited with code 1 </code></pre> <p>I rechecked my project and found that when i am removing the line <strong><code>&lt;!--#include file="admin/topstyle.asp"--&gt;</code></strong>, it is working fine. If I use this line, I am getting error building web deployment project to create my dll.</p> <p><strong>topstyle.asp</strong> is a file which render some common styles for the page like heading image and all.</p> <p>Can anyone tell me how to get rid of this problem?</p>
c# asp.net
[0, 9]
4,789,722
4,789,723
How do I get this JQuery to target & shorten URL's in a string?
<p>I'm just starting out with JQuery.</p> <p>My Question: I want to know if I can modify this code below to shorten long URLs, but ignore anything that isn't a URL? </p> <p>My Problem: This code fragment targets everything in the DIV ('tasks-overflow'). Although I just need it to affect URL's in that DIV based on protocol(http://...). There are sentences on either side of the URL.</p> <pre><code>$(document).ready(function(){ $(".tasks-overflow:contains('http://')").each(function(){ $(this).text("http://..."); }); }); </code></pre> <p>Any help would greatly be appreciated, thanks</p>
javascript jquery
[3, 5]
5,631,254
5,631,255
How to POST a javascript's result
<p>This javascript makes a custom slider work. Is ui.value the slider's value? If yes, how can I POST it?</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $( "#slider-location" ).slider({ range: "min", min: 1, max: 18, value: 15, slide: function( event, ui ) { $( "#radius" ).val( ui.value ); } }); $( "#radius" ).val( $( "#slider-range-max" ).slider( "value" ) ); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,566,751
4,566,752
How to select children and self with jQuery?
<p>I'm wondering what the best way is to find children of an element in jQuery, but also include the parent in the 'find'.</p> <p>Here's my simplified basic HTML setup:</p> <pre><code>&lt;div id="container"&gt; &lt;form id="form1"&gt; &lt;!-- form 1 content --&gt; &lt;/form&gt; &lt;form id="form2"&gt; &lt;!-- form 2 content --&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>And I want a function like this...</p> <pre><code>function getForms ($container) { // Option 1 var $allForms = $container.find('form').andSelf().filter('form'); // Option 2 var $allForms = $container.find('form'); if ($container.is('form')) $allForms.add($container); // Should return all the forms in the container if passed $('#container') // Or return just one form if passed $('#form1') return $allForms; } </code></pre> <p>I'm fairly certain that both option 1 or 2 will work. Does anyone know which option above is more efficient? Are there other options which are more elegant or more efficient?</p> <p><strong>EDIT:</strong> I wasn't happy with the <em>.is()</em> in option 2 because it didn't work when the container had multiple jQuery objects in it. So I came up with something like this:</p> <pre><code>// Option 3 function getContainerElements ($container, selector) { return $container.find(selector).add($container.filter(selector)); } </code></pre> <p>I haven't tested it too much, but I think it'll work for all general cases.</p>
javascript jquery
[3, 5]
3,797,887
3,797,888
Autocomplete on dynamically created textbox and update value on focus out of the textbox in JQuery
<p>My problem is related to creating an autocomplete functionality for a textbox that is dynamically created. And retrieve the modified value and pass it to the controller.</p> <p>I need to get value from textbox irrespective of autocomplete click or hand written in dynamic created textbox.</p> <p>I have a textbox thats created runtime like this</p> <pre><code> var txtBox= "&lt;input type='text' class='txtBox' style='min-width:10em;width:100%' value=\"" + parent.text() + "\"&gt;"; parent.html(txtBox); $("input.txtBox").focus(); $("input.txtBox").autocomplete({ source: Data, select:function() { // Call a controller method. } }); </code></pre> <p>Now, the problem im facing is that I need to pass the selected (mouse click/ hand written(new value)) to the controller's method. If instead of selecting from the auto complete values, I write a new value, the value isn't retrieved in the method.</p> <p>I also tried a blur function that would pick the value and send it to the controller's method. But this messes up everything because the onblur is called each time i click either of the autocomplete options and thereby taking an incomplete value and passing it to them controller method.</p> <p>Anyone faced such issues? Or any better ways to accomplish this issue.</p> <p>Appreciate any help.Thanks.</p>
javascript jquery
[3, 5]
788,331
788,332
Refering to controls through javascript function
<p>I have a radiobutton column in a gridview, inside many nested asp tables. I want radios enable two buttons upon click. so I added this the following function an javascript but it cannot find my controls although I turned ClientIDMode="Static" for those buttons. It returns null.</p> <pre><code>&lt;asp:GridView ID="gridView_stLists" runat="server" AutoGenerateColumns="False" CellPadding="3" BorderStyle="NotSet" CssClass="table_layout" Width="500"&gt; &lt;RowStyle CssClass="table_body" /&gt; &lt;Columns&gt; &lt;asp:TemplateField HeaderStyle-Width="20"&gt; &lt;ItemTemplate&gt; &lt;input name="radioBtn_res" type="radio" value='&lt;%# Eval("uri") %&gt;' onclick="rdBtn_onClick()" /&gt; &lt;/ItemTemplate&gt; &lt;script language="javascript" type="text/javascript"&gt; function rdBtn_onClick() { document.getElementById("btn_delete_list").enable=true; document.getElementById("btn_showRes").enable=true; } &lt;/script&gt; </code></pre> <p>can the problem be from the place of script tag? I put it under content tag.</p>
asp.net javascript
[9, 3]
133,946
133,947
Toggle Mute Javascript Function with Jquery Toggle
<p>Hi All I am trying to write both an if/else statement along with toggling an image. Basically my goal is to toggle an image (in this case with an id of soundonoff). However I can't seem to figure out where I am going wrong. The issue is the toggle works, but the detect of whether its muted or not does not work. (In my full code for example I have it switch <code>innerHTML</code> of various audio/video files, this is where <code>document.getElementsByName('mymedia')[0]</code> comes in. Any help would be tremendously appreciated I have spent about 4 hours working on this and can't seem to figure it out.</p> <p>I should add that I do not know where to add an eventlistener for <code>detectmute()</code>, I tried to add it to my video, and to the button soundonoff but neither got working yet.</p> <p>Here is my code: </p> <pre><code>function detectmute(){ if(document.getElementById('soundonoff').src == 'images/icons/soundoff.png'){ document.getElementsByName('mymedia')[0].muted = true; } else if(document.getElementById('soundonoff').src == 'images/icons/soundon.png'){ document.getElementsByName('mymedia')[0].muted = false; } $("#soundonoff").toggle(function(){ this.src = "images/icons/soundoff.png"; document.getElementsByName('mymedia')[0].muted = true; }, function() { this.src = "images/icons/soundon.png"; document.getElementsByName('mymedia')[0].muted = false; }); } </code></pre>
javascript jquery
[3, 5]
4,760,362
4,760,363
Gridview button filed dynamically add
<p>i m having one datagrid..i want to create one button field inside the datagrid dynamically. button filed type is link type.. this button field is fill after checking some condions in my database..any body helpme</p>
c# asp.net
[0, 9]
1,865,157
1,865,158
jQuery generate random number at a random time
<p>I am trying to make a plugin. In this plugin, I have two variables; rateMin and rateMax. I would like to generate a random number between these two numbers and use it as a setInterval time. Then once that number is used, make another random number and use that.</p> <p>Here's a quick example:</p> <pre><code>var defaults = { rateMin: 500, rateMax: 2000 } var options = $.extend(defaults, options); return this.each(function(defaults){ var rate = Math.floor(Math.random() * (options.rateMax - options.rateMin + 1)) + options.rateMin; // MAKE A RANDOM NUMBER BETWEEN MAX AND MIN setInterval(function(){ var rate = Math.floor(Math.random() * (options.rateMax - options.rateMin + 1)) + options.rateMin //DO SOMETHING }, rate); </code></pre> <p>I was hoping by doing it this way that the rate would override itself with a new number and be used on the next time the setInterval is called. But it is still using only the first number made before the setInterval. </p> <p>I guess I don't know how to use a variable outside of it's function.</p> <p>Any suggestions?</p>
javascript jquery
[3, 5]
1,603,032
1,603,033
Adding week number and week ranges of a year to DropDown List in ASP.NET3.5 using JQUERY
<p>I am learning jQuery. Here I have a requirement i.e I have to add Week number and Week ranges of a year to DropDown List in ASP.NET3.5. And I have to pass selected week range to database. I am using c#.net. This should be done automatically for every year.</p> <p>How can I do this using JQUERY?</p> <p>Regards,</p> <p>JN</p>
c# jquery asp.net
[0, 5, 9]
5,560,250
5,560,251
Passing value from C# codebehind to javascript
<p>What is the best way to pass a value from C# code to javascript? Currently I am setting an asp.net hidden field in the Page_Load method.</p> <p>Also if I pass a value using GET like </p> <pre><code>Response.Redirect("myurl.com/myPage.aspx?id=300"); </code></pre> <p>how can I get the value of id from myPage using javascript?</p> <p>Is there a nice way to do this in jquery?</p>
c# javascript
[0, 3]
5,789,999
5,790,000
Create a bitmap barcode
<p>I want to generate a barcode image using zxing library (or another good library if you know).</p> <p>I generate the barcode image using:</p> <pre><code>Intent intent = new Intent("com.google.zxing.client.android.ENCODE"); intent.putExtra("ENCODE_FORMAT", "CODE_128"); intent.putExtra("ENCODE_DATA", objectsId.get(position)); startActivity(intent); </code></pre> <p>how can i get the barcode image as bitmap or the path to the barcode image?</p> <p>currently i am using the zxing library</p>
java android
[1, 4]
4,607,720
4,607,721
Combine multiple click handlers into one
<p>Say I have two click handlers which perform the same functionality :</p> <pre><code>$('#div1').click(function(event) { alert('here'); }); $('#div2').click(function(event) { alert('here'); }); </code></pre> <p>How can I combine these two handlers into one instead of repeating the call to alert ?</p> <p>Something like : </p> <pre><code>$('#div1').click.('#div2').click(function(event) { alert('here'); }); </code></pre>
javascript jquery
[3, 5]
575,953
575,954
Read data from a txt file without downloading it?
<p>I want to parse information out of the text file this serves up:</p> <p><a href="http://finance.yahoo.com/d/quotes.txt?s=GOOG+YHOO&amp;f=sak2" rel="nofollow">http://finance.yahoo.com/d/quotes.txt?s=GOOG+YHOO&amp;f=sak2</a></p> <p>Is there a way to do it within an app without downloading the file first? Somehow stream the text content?</p>
java android
[1, 4]
1,664,513
1,664,514
How to disable a menu item on page load in asp.net 4.0
<pre><code>&lt;Items&gt; &lt;asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/&gt; &lt;asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/&gt; &lt;/Items&gt; </code></pre> <p>I have this menu How can I disable it during page load</p> <pre><code>page load If (Userrole==Something) { hide menu item 2 } </code></pre> <p>How can I do that.</p>
c# asp.net
[0, 9]
2,717,181
2,717,182
I want to run a php script in background
<p>I m trying to make messenger kind of service. In which I am facing a problem. I am supposed to reload the page manually. But the problem in running it automatically is that it gets reloaded for every second. I had used a javascript for reloading the page for every 1 sec. Inside which i m calling a php script. But the problem with that code is that complete page gets refreshed. Is there a way to reload only a particular part of the whole page and also i should be able run the php script in the background.</p>
php javascript
[2, 3]
4,584,651
4,584,652
Prevent displaying of previous pages after logout in php
<p>I an using session_cache_limiter ('private_no_expire, must-revalidate'); on each page to avoid "Web page has expired" issue, so that issue is resolved. But i am facing the problem with logout. When i clicked log out the page is redirect to index page but when i clicked browser back button it redirects me to previous page which should not happened. I checked out previous solutions but nothing works for me. Any help will be grateful. Thanks</p>
php javascript
[2, 3]
5,162,789
5,162,790
jQuery: Setting Functions Per Page
<p>I currently have a single jQuery script page that I include in my ScriptManager on my MasterPage (I use ASP.NET). All of my custom scripts for all my pages go in this page. I know some people like to break it up into multiple pages but I prefer having them all in one place. Anyways, I have one <code>$(document).ready(function(){ //do stuff// });</code> on this page. All of my other functions I name and then place in the document.ready function, ie:</p> <pre><code>$(document).ready(function(){ Function1(); //necessary for page1.aspx, page2.aspx but not 3 or 4 Function2(); //etc., necessary for some but not other pages }); function Function1() { // whatever, etc // } </code></pre> <p>My question centers around the efficiency of this. A lot of these functions only have any sort of application on certain pages, but not on all. Would it be better to include some page-specific coding, ie, determine what page we're on, and then if we're on the correct page, go ahead and perform the function, or does it not even matter? I was under the impression that it didn't matter, but I would like to be sure.</p> <p>Thanks</p>
asp.net jquery
[9, 5]
4,470,863
4,470,864
How can I check any of radio button is not selected
<p>I want to check whether any of radio button is not checked.How can I do it?</p> <pre><code> $(document).ready(function(){ $('#delete_btn').click(function(){ as answer if ( !($("RadioGroup1").is(':checked')) )// THis line is not wirking..I need the code for this line { }else{ //message } </code></pre>
javascript jquery
[3, 5]
2,193,159
2,193,160
Hint text is not being removed
<p><a href="http://jsfiddle.net/udit_sharma/GFknc/" rel="nofollow">http://jsfiddle.net/udit_sharma/GFknc/</a></p> <p>I have created this fiddle. which have a input box and it has hint-Text. When i am focused in this input box it's hint-Text is being cleared properly. and when i focused-out of this input box hint-Text is being showed again if there is nothing entered by user.</p> <p>But there is an issue .let say you are focused in input-box and clicked on another tab in the browser now if you comeback to this fiddle again notice that hint-Text is being shown while it was empty while leaving this page. and also its not clearing this while clicking in and out of the input box. ? </p> <p>So the issue i found is when i click on another tab onblur is not being called so that variable "valueChanged" is not being set to false. So while focusing again it is not clearing the default hint-Text value.</p> <p>So i am not getting why onBlur is not being called. If any one have clue about this, please tell or is there any other way to do this functionality ?</p>
javascript jquery
[3, 5]
4,450,576
4,450,577
How can I access a GridView on a page from a control on a Page?
<p>I have an aspx page which has a GridView and a Panel with Summary Data. The Summary Data is in a control and the GridView is on the aspx page. When someone clicks an item in the Summary Data, I want to rebind the GridView, but I can't figure out how to do it from the control.</p> <p>I tried using FindControl, but probably did not use it correctly.</p> <p>I tried this with FindControl, but it didn't work:</p> <pre><code>GridView gv = (GridView)FindControl("gvSearchResults"); //returns null </code></pre>
c# asp.net
[0, 9]
4,471,999
4,472,000
Rendering an html fragment with a jQuery script
<p>I'm writting my first jQuery script which should render a list of anchors in a div (whose id is #content) when I click on another anchor (#dwLink). I get are the links displayed as I want, but just for milliseconds! then they dissapear.</p> <p>This is the script I wrote:</p> <pre><code>$(document).ready(function() { $('#dwLink').bind('click', function() { $('#content').html( "&lt;ul&gt;" + "&lt;li&gt;&lt;a href=\"#\"&gt;Link 1&lt;/a&gt;&lt;/li&gt;" + "&lt;li&gt;&lt;a href=\"#\"&gt;Link 2&lt;/a&gt;&lt;/li&gt;" + "&lt;li&gt;&lt;a href=\"#\"&gt;Link 3&lt;/a&gt;&lt;/li&gt;" + "&lt;/ul&gt;" ); }); }); </code></pre> <p>Does it have something wrong? I can't find where the problem is. I know I could do it by writting plain javascript since it is a basic dom manipulation problem, but I want to do it in a jQueryesque way. I hope you can help me. Thanks!</p>
javascript jquery
[3, 5]
1,934,284
1,934,285
Call Javascript function from Jquery
<p>I have a Javascript function from a Google Maps tutorial</p> <pre><code>&lt;script type="text/javascript"&gt; function initialize() { ... } &lt;/script </code></pre> <p>And in the Tutorial it gets called by body onload. But as i have jquery code anyway I thought i would just call it from there. So i just tried</p> <pre><code>$(document).ready(function() { initialize(); }); </code></pre> <p>But then no jquery works at all. How do i call this function the correct way?</p>
javascript jquery
[3, 5]
5,177,858
5,177,859
show only the table rows that contain <td> and have a checked check box?
<p>How do I show only the table rows that contain <code>&lt;td&gt;</code> and have a checked check box?</p> <pre><code>var myTable = '#testTable'; $(myTable).find('tr').has('checkbox:checked').has('td').show(); </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
3,663,326
3,663,327
improving website performance by dynamically loading javascript?
<p>I was wondering if this is something normally done or possible (I am a novice) suppose you have kind of a heavy javascripted site. A web app page basically. What if part of the page is a mailbox... and the user doesn't necessarily use it right away. Could you possibly download the javascript that the mailbox requires after the page has loaded or maybe even as they need to use the mailbox? I saw this from another question:</p> <pre><code>$.getScript("my_lovely_script.js", function(){ alert("Script loaded and executed."); </code></pre>
javascript jquery
[3, 5]
4,545,768
4,545,769
getAttribute() method in javascript
<p>How to retrieve the text given in any field using javascript in C#?</p> <pre><code>sumry.innerHTML += "&lt;li&gt;" + f.getAttribute("Text") + "&lt;/li&gt;" + "&lt;br/&gt;"; f.style.borderColor = "#FF0000"; f.focus(); </code></pre>
c# javascript
[0, 3]
841,944
841,945
Android: buffer blocked until process exited
<p>I have a problem with blocking buffer with the following code on my android application:</p> <pre><code> else if (tcpdumpButton.isChecked()) { try { Process process1 = Runtime.getRuntime().exec("tcpdump"); BufferedReader osRes = new BufferedReader(new InputStreamReader(process1.getInputStream())); StringBuffer output = new StringBuffer(); String line=""; while ((line = osRes.readLine()) != null) { output.append(line); output.append("\n"); tv.setText(output); setContentView(tv); } } catch (Exception e) { throw e; } } </code></pre> <p>Since the tcpdump process is running continuously and never terminated i am unable to print the buffer contents on the screen.Can anybody tell me what i should do or give an example on how to read the buffer and print it on the screen without waiting for the process to terminate??</p>
android java
[4, 1]
2,914,255
2,914,256
change select tag attribute value
<p>I have one drop down menu. By default it allows only one option to select among all. I want to create a checkbox which when checked should change that dropdown menu to allow multiple options to be selected. Can someone tell me how to achieve this?</p> <pre><code>&lt;select id="test" name="host"&gt; &lt;option value="host1"&gt;host1&lt;/option&gt; &lt;option value="host2"&gt;host2&lt;/option&gt; ..... ..... &lt;/select&gt; </code></pre> <p>I want this to be changed to following on checkbox being checked.</p> <pre><code>&lt;select id="test" name="host" multiple="multiple"&gt; &lt;option value="host1"&gt;host1&lt;/option&gt; &lt;option value="host2"&gt;host2&lt;/option&gt; ..... ..... &lt;/select&gt; </code></pre> <p>Please help me in doing this.</p>
php javascript
[2, 3]
2,767,960
2,767,961
RenderBody in php
<p>If you have used ASP.NET MVC you'd be familiar with RenderBody. Basically, you have one layout page and several body pages. Something like this:</p> <p>layout.cshtml:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Your Title&lt;/title&gt; &lt;/head&gt; &lt;body&gt; @RenderBody() &lt;/body&gt; &lt;/html&gt; </code></pre> <p>index.cshtml:</p> <pre><code>@{ layout = "layout.cshtml"; } &lt;p&gt;Hello World!&lt;/p&gt; </code></pre> <p>So when you call index.cshtml, all of its content will be shown in the layout's <code>@RenderBody</code> section. This is really useful when your pages use a single layout. </p> <p>Now, my question is, how could I achieve something similar to the code above in php?</p> <p><strong>EDIT</strong></p> <p>For those who are not familiar with ASP.NET, when you have an index2.cshtml file like this:</p> <pre><code>@{ layout = "layout.cshtml"; } &lt;p&gt;Hello World, once again!&lt;/p&gt; </code></pre> <p>Then when you call index2.cshtml this time 'Hello World, once again!' would be printed. So basically, when you define the page's layout, all of its content is displayed in the @RenderBody section of its layout. You don't have to explicitly define what page to include in the layout. </p>
php asp.net
[2, 9]
2,062,606
2,062,607
Jquery randomly hide 2 number without repeating the previous one
<p>How can i randomly chose any 2 numbers and hide it using jquery. i know that i can just use the function twice and it will work 2 times. but it will repeat the previous too. therefore sometime one of the element will not hide.</p> <pre><code>randomtip = function(){ var length = $("li.ad1 a").length; var ran = Math.floor(Math.random()*length); $("li.ad1 a:nth-child(" + ran + " )").hide(); }; randomtip(); </code></pre>
javascript jquery
[3, 5]
4,592,098
4,592,099
JQuery Validation for Two Password Fields
<p>Two entered passwords should be the same, and I want to display a notification when they're not matching. The target is to display the notification during typing and not after pressing the save Button. </p> <p>I am new to javascript and I have also tried the functionname function() notation.</p> <p>following js:</p> <pre><code>function updateError (error) { if (error == true) { $(".error").hide(500); }else{ $(".error").show(500); } }; function checkSame() { var passwordVal = $("input[name=password-check]").val(); var checkVal = $("input[name=password]").val(); if (passwordVal == checkVal) { return true; } return false; }; document.ready(function(){ $("input[name=password-check]").keyup(function(){updateError(checkSame());}); $("input[name=password]").keyup(function(){updateError(checkSame());}); }); </code></pre> <p>and HTML:</p> <pre><code> @Html.Password("password") @Html.Password("password-check") &lt;span class="error"&gt;Errortext&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt; </code></pre> <p>but it doesn't works.. Thx!</p> <p>Edit: Now i've changed the JS code to:</p> <p>$("input[name=password-check]").keyup(function(){updateError(checkSame());}); $("input[name=password]").keyup(function(){updateError(checkSame());});</p> <p>--> now it works, but only once, after the user typed a matching password, validation stops working</p> <p>Solved, problem was Quoting:</p> <pre><code>$("input[name='password-check']").keyup(function(){updateError(checkSame());}); $("input[name='password']").keyup(function(){updateError(checkSame());}); </code></pre>
javascript jquery
[3, 5]
4,132,494
4,132,495
JQuery 1.3 upgrade considerations
<p>I hear nothing but great things about the newest version of jQuery 1.3. Has anyone experienced any problems upgrading from 1.2.6? I would love to use it but I want to know if there are any gotchas first.</p> <p>EDIT: 1.3.1 is out. </p>
javascript jquery
[3, 5]
4,455,937
4,455,938
how can i detect click in any frame on the page
<p>I have this function that hides a div when something in the document is clicked. but it only works in its frame. it doesnt detect document clicks in other frames on the webpage. i've tired <code>$(parent).click(</code> but it doesnt work. is there any way?</p> <pre><code> $(function (){ $(document).click( function (e){ ... } ) }) </code></pre>
javascript jquery
[3, 5]
5,648,360
5,648,361
Javascript - generating a random number of specified length from set of specified values
<p>I wanted to generate a random number 32 characters in length from a specified set of characters.</p> <p>For example:</p> <pre><code>var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ"; var string_length = 32; </code></pre> <p>Which would then return a random number of length 32 using the specified characters. </p>
javascript jquery
[3, 5]
4,428,387
4,428,388
Communications between a C# PC program and an android tablet
<p>I would like to transfer a file from android tablet to PC via Wi-Fi connection. Is this any way to transfer a file form android Tablet to PC using <strong>.Net</strong>.</p> <p>Any idea or Sample code let me know.</p> <p>Thanks Sabarish</p>
c# android
[0, 4]
4,831,511
4,831,512
Javascript replace has no effect
<p>This is the jQuery:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ var relName; $('.child').each(function() { relName = $(this).attr('rel'); relName.replace('&amp;',''); $(this).attr('rel', relName); $(this).appendTo('#' + $(this).attr('rel')); }); }); &lt;/script&gt; </code></pre> <p>With this relevant HTML:</p> <pre><code>&lt;div rel="MadDogs&amp;EnglishmenHandpaintedfigurines" id="Figurines" class="category section child"&gt; &lt;h3 class="categoryTitle"&gt;Figurines&lt;/h3&gt; &lt;/div&gt; </code></pre> <p>But for some reason, the replace has no effect whatsoever!</p>
javascript jquery
[3, 5]
1,577,552
1,577,553
Multiplatform Game-Center
<p>To build an app where we want to use some integration with Facebook, multiple opponents, achievements and stuff... we are looking for the best way to do this.</p> <p>Now, Apple has there game center which won't works with Android same will probably hold with for the Google counter part. What are the best alternatives for building such a system and/or implementing one in an Android and iOs environment? </p>
android iphone
[4, 8]
3,333,739
3,333,740
how can i call a throwable method inside a runnable, for creating a new thread
<p>while trying to create a progressbar in android i came across this problem. i am following this example : <a href="http://developer.android.com/reference/android/widget/ProgressBar.html" rel="nofollow">http://developer.android.com/reference/android/widget/ProgressBar.html</a></p> <p>my problem is that one of my methods i want to call has to be inside a try and catch how do i do that inside of a runnable?</p> <pre><code>Runnable SendThread = new Runnable() { try { GetAndConvertImagesToPdf(); mProgStatus = 30; mProgress.setProgress(mProgStatus); title.setText(R.string.sendingTitle); } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }; </code></pre> <p>i get this error: </p> <p>"Syntax error on token try, delete this token"</p> <p>how can i resolve this?</p> <p>thank you</p>
java android
[1, 4]
1,590,025
1,590,026
public void onConfigurationChanged(Configuration newConfig) is not calling
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6457659/android-onconfigurationchanged-not-being-called">Android onConfigurationChanged not being called</a> </p> </blockquote> <p>I Have the same problem.</p> <pre><code>&lt;activity android:name="com.sailbook.MainActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>.</p> <pre><code>@Override public void onConfigurationChanged(final Configuration newConfig) { super.onConfigurationChanged(newConfig); } </code></pre> <p>I set a breakpoint, but the debugger does not hold if i turn the phone in "onConfigurationChanged".</p> <p>I want that the main activity does not recreated when I turn the phone. But the content should rotate.</p>
java android
[1, 4]
3,100,800
3,100,801
Adding SqlParameter
<p>I am re-writing a login process I wrote in Console to a web based application and keep getting hung up when I add the SqlParamater. For some reason it doesn't recogize FirstName and gives the error "The FirstName does not exist in current context".</p> <p>How can I solve this?</p> <pre><code>//set the command object so it knows to execute a stored procedure cmd.CommandType = CommandType.StoredProcedure; //Doesn't understand line under.... cmd.Parameters.Add(new SqlParameter("@FirstName", FirstName)); parmReturnValue = cmd.Parameters.AddWithValue("@UserId", SqlDbType.Int); parmReturnValue.Direction = ParameterDirection.ReturnValue; </code></pre>
c# asp.net
[0, 9]
5,131,305
5,131,306
ASP.NET/UserControls: How do I sepparate the "controller" from the "view"?
<p>Is it possible to sepparate the ascx ("view") and the ascx.cs ("controller") pars of a user control. Id like to move the controller part to App_Code to be resued while the view part is changed between projects?</p>
c# asp.net
[0, 9]
5,688,292
5,688,293
Is there a way for JS to detect that the bottom of a div has been reached, rather than the bottom of a page?
<p>I'm using this at the moment:</p> <pre><code>$(window).scroll(function() { if($(window).scrollTop() + $(window).height() == $(document).height()) { $(".initial").delay(2000).fadeOut("slow", function() { $(".secondary").fadeIn("slow"); }); } }); </code></pre> <p>And I've tried fiddling around with <code>window</code> and replacing it with div names and static pixel values for the scroll to no avail.</p>
javascript jquery
[3, 5]
555,809
555,810
Is it worth coding for users who may not have JavaScript enabled?
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/3485890/how-safe-is-it-to-assume-that-most-users-will-have-js-enabled">How safe is it to assume that most users will have JS enabled?</a><br> <a href="http://stackoverflow.com/questions/155615/is-it-reasonable-to-assume-my-visitors-have-javascript-enabled">Is it reasonable to assume my visitors have javascript enabled?</a> </p> </blockquote> <p>I'm worrying about this and don't know if I should be.</p>
javascript jquery
[3, 5]
2,251,981
2,251,982
ASP.NET: Problems with referencing a user control in another user control?
<p>I'm having problems in a usecontrol referencing a other usercontrol:</p> <pre><code>using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class includes_EnquiryRssButton : System.Web.UI.UserControl { public includes_EnquirySearchForm EnquirySearchForm { get; set; } //compile error ... } </code></pre> <p>I get a compile error saying that type of namespace can't be found. The annoying part is that I think I had it working earlier. </p>
c# asp.net
[0, 9]
1,449,892
1,449,893
How to assign the selected value of Drop down to text box
<p>I'm trying to assign the selected value in the drop down to text box when ever I hit a button. I'm not able to see the selected value in the <code>TextBox</code>. Can someone please let me know what am I missing?</p> <p>My code is as follows:</p> <pre><code>public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click1(object sender, EventArgs e) { string strConn = "Initial Catalog=NavigateV6;Data Source=SVUSRYE-SQL3D1;User ID=dopis_user;Password=dopis_password;Persist Security Info=True;MultipleActiveResultSets=True"; SqlConnection mycn = new SqlConnection(strConn); DataSet ds = new DataSet(); SqlDataAdapter myda = new SqlDataAdapter("Select accountid FROM trn_account ", mycn); myda.Fill(ds); DDL.DataSource = ds; DDL.DataTextField = "AccountID"; DDL.DataValueField = "AccountID"; DDL.DataBind(); } protected void DDL_SelectedIndexChanged(Object sender, EventArgs e) { var selectedValue = ((DropDownList)sender).SelectedValue; if (!string.IsNullOrEmpty(TextBox1.Text)) TextBox1.Text = selectedValue; } } </code></pre> <p>ASPX:</p> <pre class="lang-xml prettyprint-override"><code>&lt;asp:DropDownList ID="DDL" runat="server" AutoPostBack="True" OnSelectedIndexChanged = " DDL_SelectedIndexChanged" &gt; &lt;/asp:DropDownList&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;asp:Button ID="Button1" runat="server" onclick="Button1_Click1" Text="sumbit" /&gt; &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;/asp:Content&gt; </code></pre>
c# asp.net
[0, 9]
4,729,083
4,729,084
How to interpret JavaScript with Python
<p>It is possible to run JavaScript with Python? There are any library that makes this possible?</p> <p>I need to execute some JavaScript, I know that this is possible with some Java libraries, but I prefer Python.</p> <p>Can someone give me a clue on this?</p> <p>Best Regards,</p>
javascript python
[3, 7]
5,699,835
5,699,836
Different Form Fields for Different Requirements
<p>I am working on a <code>Job Application Project</code>, <code>Admin Panel</code> and <code>Front End</code>.Add Vacancy from Admin panel and Apply from Front End Against a job using Application form. Requirements are.</p> <blockquote> <p>When Applying for a Specific job, Input Fields in the Application form can change for different Jobs. like some job can ask for Gender and some can ask for Age..? </p> </blockquote> <p>Please Guide when Adding Vacancies, how can I Achieve point 1.. so different jobs have different Requirements...</p>
c# asp.net
[0, 9]
5,292,984
5,292,985
C# error breaks program when coming from JS button, yet C# button functions fine. What am I doing wrong?
<p>First let me explain what my program does. I have a web browser inside of a form. I have a class dedicated to cross communication between the webpage and the program. In order for my class to communicate with the other class where most of the code is, I have to do the following (which I suspect is the problem): </p> <pre><code>public class TEST { public void goHere() { Form1 frm1 = new Form1(); frm1.another(); } } public partial class Form1 : Form { public void another() { //do stuff } } </code></pre> <p>The TEST class is only called from the via Javascript.<br> I get the error: </p> <pre><code>An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll Additional information: Exception has been thrown by the target of an invocation. </code></pre> <p>This happens at: </p> <pre><code> static void Main() { Application.Run(new Form1()); } </code></pre> <p>In order to get to that line the program executes this line: </p> <pre><code> webKitBrowser1.Invoke(new MethodInvoker(delegate { webKitBrowser1.GetScriptManager.CallFunction("doStuff", new Object[] { }); })); </code></pre> <p>In order to see if my communication between classes was an issue, I simply called another(); from a C# button. I did not encounter the error. This leads me to believe that the Form1 frm1 = new Form1(); line is causing an error. Any ideas on how to fix this? Is my diagnosis correct? </p>
c# javascript
[0, 3]
3,783,043
3,783,044
JavaScript Date with jQuery Countdown
<p>I'm trying to show a simple countdown from 2 hours like so:</p> <pre><code>$(function () { var timeout = new Date(20000); $('#countdown').countdown({until: timeout, compact: true, format: 'HMS'}); }); </code></pre> <p>However I just get 00:00:00, any ideas why?</p>
javascript jquery
[3, 5]
367,462
367,463
Converting two python lines code to PHP
<p>I have those two lines of code written in python i want to convert them to php, please help i don't know how to do this in php.</p> <pre><code>#code in python: vowels= re.compile(ur'[\u064B-\u0652]') newstr = vowels.sub('', str) </code></pre> <p>thank you</p>
php python
[2, 7]
5,249,746
5,249,747
The type is deprecated
<p>I am using an AbsoluteLayout for a Activity and have it defined in a xml file.</p> <p>I added this line of code because I am trying to add a list of buttons dynamically and I get the following warning.</p> <pre><code>private AbsoluteLayout layout = (AbsoluteLayout) findViewById(R.id.viewsaved); The type AbsoluteLayout is deprecated </code></pre> <p>The code still appears to work properly, but I was just curious to see if anyone knows why this warning appears?</p> <p>Thanks for any help!</p>
java android
[1, 4]
4,202,827
4,202,828
Converting a popup window uploader to an inline script using jQuery?
<p>I have a few buttons in my script that call window.open('myUploadScript.php?arguments=test...',''). </p> <p>I'm passing querystring parameters in the arguments() for the target file myUploadScript.php to process.</p> <p>I'd like to call this script without opening it in a popup. Can I use jQuery for this without having to start from scratch on my popup window script?</p> <p>In other words, my window.open contains:</p> <pre><code>&lt;input type="button" id="myButton" value="myValue" onclick="window.open('myUploadScript.php?action=test', 'popup', 'width=330, height=300, scrollbars=no, resizable=no, toolbar=no, directories=no, location=no, menubar=no, status=no'); return false" /&gt; </code></pre> <p>Can I instead call a jQuery that loads the contents of myUploadScript.php into a placeholder div, passing it the "test" argument?</p>
php jquery
[2, 5]
3,487,050
3,487,051
jQuery delay not working after three seconds
<p>After 3 seconds... the alert prompted does not show up. What am I doing wrong?</p> <pre><code>$(function() { $("#test").live("click",function() { $("#test2").delay(3000, function({ alert('Hello!'); }) ); }); }); </code></pre>
javascript jquery
[3, 5]
1,856,017
1,856,018
Stuck for how to accomplish a task
<p>Here's what I'd like to do: we have a list of members who need to be redirected to a series of forms on URLs. We have around 5 forms and 200members. They would be greeted at a site, enter their First and Last name and then be redirected to the applicable form which we selected for them. Starting from scratch with this so any hints as to process would be hugely appreciated. Thanks in advance! </p>
java php
[1, 2]
3,370,191
3,370,192
Applying style using javascript doesn't work always
<p>I am applying style to div using JavaScript it appears well at the first time but when I click an image to open a virtual window the applied CSS goes away. </p> <p>How can I apply style using script that stays forever.</p> <p>**There is no way left for me to apply any style at design time because I am using ready made user control and I get ID for the DIV only at run time.</p> <p>Any Idea??</p> <p>Here is the script I am using...</p> <pre><code>window.onload = changeDivOverflow; function changeDivOverflow() { var treeDiv = document.getElementById('T_ctl00contentMainctl04tvw'); treeDiv.style.overflow = "auto"; } </code></pre>
asp.net javascript
[9, 3]
5,841,322
5,841,323
How to pass javascript var to server side on asp.net
<p>I'm trying to pass a textarea value to the server side. The textarea cant be runat=server though. heres my code:</p> <pre><code>&lt;script type="text/javascript"&gt; function replace() { //Replace &lt; and &gt; on textarea var obj = document.getElementById('recipient_list'); var str = obj.value; str = str.replace(/&lt;/i, "("); str = str.replace(/&gt;/i, ")"); obj.value = str; alert("rec_lst.value: " + document.getElementById('recipient_list').value); //Pass value to server. alert("passing to server"); document.getElementById("ctl00$ContentPlaceHolder1$txtEmails").value = str; alert("Passed to server"); alert("txtEmails.value: " + document.getElementById("ctl00$ContentPlaceHolder1$txtEmails").value); } &lt;/script&gt; </code></pre> <p>This isn't working though... Any ideas how to fix or better implement this??..</p>
javascript asp.net
[3, 9]
4,829,533
4,829,534
how to detect if variable is a string
<p>How can I detect if a variable is a string?</p>
javascript jquery
[3, 5]
4,844,086
4,844,087
How to show an error message dialogs in Asp.net
<p>How to show an <code>error messages</code> or <code>data validation messages</code> in Asp.net with c# language. Please guide me.</p>
c# asp.net
[0, 9]
5,258,794
5,258,795
ajQuery - Start slideshow on click
<p>I'm new to jQuery and would like to start a slideshow after a link is clicked instead of after the page is loaded. How to do that?</p> <pre><code>&gt; &lt;script type="text/javascript"&gt; &gt; jQuery(document).ready(function($){ $("a[rel^='id']").prettyPhoto({ &gt; theme: 'pp_default',slideshow:5000, autoplay_slideshow:true}); &gt; }); &gt; &lt;/script&gt; </code></pre> <p>I would like to start it like this:</p> <pre><code>&lt;a href="javascript:startSlideshow()"&gt;Start Slideshow&lt;/a&gt; </code></pre>
javascript jquery
[3, 5]
2,994,370
2,994,371
Is there a JavaScript or jQuery equivalent to Python's "sum" built-in function?
<p>Say I have an array-ish container of decimal numbers. I want the sum. In Python I would do this:</p> <pre><code>x = [1.2, 3.4, 5.6] sum(x) </code></pre> <p>Is there a similarly concise way to do this in JavaScript?</p>
javascript jquery python
[3, 5, 7]
1,554,187
1,554,188
clear radiobutton list selection using jquery
<p>I would like to clear Radiobutton list selection after user enters the text in the TextBox. I tried the following code but it doesn't seem to be working and it doesn't show any error. Please let me know if there are any suggestions.</p> <pre><code>function ClearRadioButtonList() { var checkboxlistid9 = "#&lt;%= rblLst.ClientID %&gt;"; $('.checkboxlistid9').attr('checked',false); } &lt;telerik:RadMaskedTextBox ID="txtCode" runat="server" Mask="###-##-####" SelectionOnFocus="CaretToBeginning"&gt; &lt;ClientEvents OnBlur="ClearRadioButtonList" /&gt; &lt;/telerik:RadMaskedTextBox&gt; &lt;asp:RadioButtonList ID="rblLst" runat="server" RepeatDirection="Horizontal"&gt; &lt;asp:ListItem Value="1"&gt;Unknown&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="2"&gt;Not Applicable&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; </code></pre>
javascript jquery asp.net
[3, 5, 9]
183,370
183,371
$_POST array is empty when POSTing with C# WebRequest
<p>I've been trying to get some client-server interaction happening with JSON, however, the data that I post to the server is not arriving; the <code>$_POST</code> array in my PHP script is empty.</p> <p>I've just ended up grabbing the WebRequest example straight from <a href="http://msdn.microsoft.com/en-us/library/debx8sh9.aspx" rel="nofollow">MSDN</a> and testing that. That still doesn't work. I've also tried just posting some data with HTML form, and that works fine. I'm completely stumped.</p> <p>When I call <code>getallheaders()</code> in my PHP I get</p> <pre><code>OK array(5) { ["Content-Type"]=&gt; string(33) "application/x-www-form-urlencoded" ["Host"]=&gt; string(9) "localhost" ["Content-Length"]=&gt; string(2) "54" ["Expect"]=&gt; string(12) "100-continue" ["Connection"]=&gt; string(10) "Keep-Alive" </code></pre> <p>though doing a var_dump($_POST) returns array(0)</p> <p>Can anyone suggest anything?</p>
c# php
[0, 2]
5,394,184
5,394,185
JavaScript / PHP: Get a Client's Month and Day with JS, Pass the Values to PHP Variable
<p>I want to get day and month from a client's computer, and then pass it to PHP in two separate variables, which would result in something like this:</p> <pre><code>$day_num = 11; $month_num = 12; </code></pre> <p>I need JavaScript function and PHP function to be separate files, and I need to pass the value not in the URL. </p> <p>I would be grateful for a bit of help from an expert!</p>
php javascript
[2, 3]
2,643,483
2,643,484
Problem with ModalPopupExtender in AJAX in asp.net c#
<p>I have one form to save customer details.For that i have used updatepanel &amp; formview. Also i used modalpopupextender to open popup in Click event of image button inside that form. But when i am using modalpopupextender then i cant save my customer details, without use of modalpopupextender i can save customer details. For that i have added code as following, but its giving error as <code>"An extender can't be in a different UpdatePanel than the control it extends."</code> :</p> <pre><code> &lt;asp:ImageButton ID="imb1" Text="Refresh Panel" runat="server" /&gt; &lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="imb1" /&gt; &lt;/Triggers&gt; &lt;ContentTemplate&gt; // Here is my code to add &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>Please help me what to do? Asp.net c#</p>
c# asp.net
[0, 9]
2,134,732
2,134,733
How to bind data dynamically to RadioButtonList in asp:repeater using c#?
<p>i want to make a MCQ test paper like following:</p> <ol> <li>question1</li> </ol> <p>radiobuttonlist with values ans1,ans2,ans3,ans4</p> <ol> <li>question2</li> </ol> <p>radiobuttonlist with values ans5,ans6,ans7,ans8</p> <p>all the values of answers and questions must be retrieved from database.</p> <p>please help me..!!.. i need answer urgently..</p> <p>thanks in advance... </p>
c# asp.net
[0, 9]
5,529,931
5,529,932
Add multiple unique ids to an element
<p>I need to add a second unique id to an element.</p> <p>I use this to generate new ids</p> <pre><code>var id = 1; function getNextId() { return ++id; } </code></pre> <p>Then I am doing this</p> <pre><code>$('&lt;div id="content '" + getNextId() +"'" class="span6"&gt;&lt;/div&gt;').appendTo('.new'); </code></pre> <p>But I am getting an <code>Uncaight SyntaxError: Unexpected identifier</code></p> <p>How can I add multiple ids where the second is a unique one?</p> <p>(I am remove the first id on a click, so I'm ok with leaving #content there)</p> <p>Multiple ids on an element have been discussed in here: <a href="http://stackoverflow.com/questions/192048/can-an-html-element-have-multiple-ids">Can an html element have multiple ids?</a></p>
javascript jquery
[3, 5]
856,097
856,098
How to disable submit button with jquery?
<p>I have a checkbox which needs to be checked in order for it to be possible to submit the form.</p> <p>So I set the submit button disabled attribute to "disabled". Then I tried binding the checkbox to it like this so it would enable/disable the submit button. It does not work:</p> <pre><code>$('input[type=checkbox]#confirm').click(function() { if ($(this).is(':checked')) { $('#submitButton').removeAttr('disabled'); } else { $('#submitButton').attr('disabled', 'disabled'); } }); </code></pre> <p>The submit button stays disabled.</p> <p>HTML:</p> <pre><code>&lt;form enctype="application/x-www-form-urlencoded" method="post" action="/controller/action"&gt;&lt;dl class="zend_form"&gt; &lt;dd id="confirm-element"&gt; &lt;input type="hidden" name="confirm" value="0"&gt;&lt;input type="checkbox" name="confirm" id="confirm" value="1" class="input-checkbox"&gt;&lt;/dd&gt; &lt;dt id="confirm-label"&gt;&lt;label for="confirm" class="required"&gt;Lorem ipsum.&lt;/label&gt;&lt;/dt&gt; &lt;dt id="submitButton-label"&gt;&amp;#160;&lt;/dt&gt;&lt;dd id="submitButton-element"&gt; &lt;input type="submit" name="submitButton" id="submitButton" value="Potvrdiť" class="input-submit" disabled="disabled"&gt;&lt;/dd&gt; &lt;input type="hidden" name="csrf_token" value="ed3e9347145a3eb3d58c4c21d813df26" id=""&gt;&lt;/dl&gt;&lt;/form&gt; </code></pre>
javascript jquery
[3, 5]
5,219,709
5,219,710
Complex text formatting ASP.NET/C#
<p>Accused to be not detailed enough, now I'll try to be detailed and descriptive as possible.</p> <p>So, I have web application with textbox. Next to it I made label for preview, so when I click Submit, it sends text to remote application, when I press preview, it sends text to label for preview.</p> <p>Remote application have specific text formatting, so When I type <code>A</code> text becomes red, <code>B</code>, text becomes green, and so on. When I wan't to change color, I type this sign for new color, I can't close color (like in HTML). For new line, I also have a sign, it's @r I also have sign for double width.</p> <p>Main problem is to do following things:</p> <ol> <li>Count characters and spaces, and break line on last space before 30th sign (replace space with @r (new row sign), so space wouldn't be taken to next row). None of the @x(x is some letter) should be counted, as they just do text formatting.</li> <li>While counting characters, when it comes to %Y (sign for double letter's width), it should count double those letters and spaces until it comes to @Z or @W, where normal letters with starts again, and from that point, count again one by one letter.</li> </ol> <p>If anything is not clear enough, please ask.</p>
c# asp.net
[0, 9]
5,857,617
5,857,618
How to convert this milliseconds into time (hh:mm a)?
<p>I have milliseconds like "1325085788" i want to convert it on hh:mm a . i know this but return me time 01:34 PM instead of 08:53 PM.Whats problem ? </p> <p>My code is :: </p> <pre><code>String created_on = "1325085788"; String pattern = "hh:mm a"; SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); Date date = new Date(Long.parseLong(created_on)); String yourFormatedDate = dateFormat.format(date); System.out.println("--------&gt; " + yourFormatedDate); </code></pre> <p><strong>no timezone issue because it give me current time (in india) in iphone app</strong></p>
java android
[1, 4]
5,590,265
5,590,266
Import Contact from yahoo,Hotmail(Script in c#)
<p>i would like to import contacts from gmail/hotmail/yahoo to my c# applications just like those found in social network.</p> <p>I need a referral system like DropBox has. Has anyone coded it themselves or is it available as open source?</p> <p><a href="https://www.dropbox.com/referrals" rel="nofollow">https://www.dropbox.com/referrals</a></p> <p>Thanks in Advance..</p>
c# javascript
[0, 3]
1,243,589
1,243,590
Detect last call of JQuery Plugin Constructor after multiple instantiation
<p>I'm building a JQuery Plugin that users will be able to call multiple times depending on specific options and preferences.</p> <p>I'm looking for a way to know when they make the last call, because I need to execute some code during the very last call.</p> <p>For example, let's say the code is thus:</p> <pre><code>$('body').myPlugin(options_1); $('body').myPlugin(options_2); $('body').myPlugin(options_3); </code></pre> <p>Is there a way for me to determine how many times that my plugin constructor has been defined e.g. before my plugin code is run, or from the last plugin constructor?!</p> <p>Just as an analogy, in JQuery there is the <code>.last()</code> method to get the last item in a set of matched elements. I'm trying to do the same thing, only this time with Javascript Constructors, so can run some code at the end of all the calls.</p>
javascript jquery
[3, 5]
1,185,962
1,185,963
Android opening pdf isn't working
<p>I've been trying to get this working for some time now. I've seen the other questions here about how to open pdfs from Android, and the general consensus is the code that I have below. Am I missing something?</p> <pre><code> try { Uri path = Uri.parse("android.resource://com.TeamGLaDOS.DayTradeSim/" + R.raw.teamdoc); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/pdf"); this.startActivity(intent); } catch(ActivityNotFoundException e) { Toast.makeText(this, "No Application Available to view PDF", Toast.LENGTH_SHORT).show(); } </code></pre> <p><strong>Edit:</strong> It always throws the ActivityNotFoundException and shows the Toast. </p> <p>The exception message is this:</p> <pre><code>android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=android.resource://com.TeamGLaDOS.DayTradeSim/2130968576 typ=application/pdf } </code></pre> <p><strong>Edit 2:</strong> I have a pdf application installed (Aldiko) and I've used other apps to launch pdfs in Aldiko before. </p>
java android
[1, 4]
5,416,005
5,416,006
How to use a php variable in an external javascript code?
<p>Usually, when i need to use some php in javascript code, i use to put the code into the head like this :</p> <pre><code>&lt;script&gt; $(function() { $("input#datepicker").val('&lt;?php echo $date ?&gt;'); }); &lt;/script&gt; </code></pre> <p>This way, i can use some php variables in javascript code. It works fine.</p> <p>Do you know how to do this if i want to put all javascript code in an external js file :</p> <pre><code>&lt;script type="text/javascript" src="js/admin.js"&gt;&lt;/script&gt; </code></pre> <p>Maybe it doesn't matter at all. But i use to code in an external js file and and i'm wondering if it's possible to do that.</p>
php javascript jquery
[2, 3, 5]
4,735,120
4,735,121
Can we put OR condition in .find() function
<p>I am trying to do something like :</p> <pre><code>$(".test").find("button or input[type=button]") </code></pre> <p>How can i do this?</p>
javascript jquery
[3, 5]
751,951
751,952
Jquery code on load not firing
<p>I have the following JQuery code in a external JS file linked into a usercontrol in .Net 1.1 webapp.</p> <p>The usercontrol is a timesheet.</p> <p>When the page loads it calls MonthChange and works fine in one page.</p> <p>But now I want to load the timesheet/usercontrol into aother webpage that pops up a in a new browser window for printing.</p> <p>Problem is my MonthChange is not firing.</p> <p>Any ideas why???</p> <pre><code>$(function() { MonthChange(); //TestData(); $('[class^=TSGridTB]').blur(function() { var day = GetDay($(this).attr('id')); var date = GetRowDate(day); var bgcolor = GetInputFieldColor(date, false); $(this).css("background-color", bgcolor); $(this).parent().css("background-color", bgcolor); //CalcHours($(this).get(0)); }); $('[class^=TSGridTB]').focus(function() { var day = GetDay($(this).attr('id')); var date = GetRowDate(day); var bgcolor = GetInputFieldColor(date, true); $(this).css("background-color", bgcolor); $(this).parent().css("background-color", bgcolor); }); $('[id$=lstMonth]').change(function() { MonthChange(); }); }); </code></pre>
asp.net jquery
[9, 5]
5,195,814
5,195,815
Converting Indonesian (id-ID) Date To English (en-US) Date
<p>I am facing problem while converting Indonesian Date to English Date. Ex : I got an Date which is in Indonesian Language <code>i.e 24/mars/1958</code> so I have to convert this date to English Date <code>i.e 24/mar/1958</code> I tried to convert the date by using following code</p> <pre><code>string date = "24/mars/1958"; string newDate = DateTime.Parse(date, new CultureInfo("id-ID")).ToShortDateString(); </code></pre> <p>but the above code is throwing error so can any one let me know how to convert this date to English Date </p> <p>Thanks in Advance Nitesh Katare</p>
c# asp.net
[0, 9]
3,174,918
3,174,919
Totalling checked checkboxes amidst changes
<p>I have a page with many checkboxes, each of which are tied to a product with a price. I'm trying to use jQuery to give a real-time readout of the 1) number of products, and 2) total price of the user's selections.</p> <p>This <em>should</em> be very easy: I would have done something like:</p> <pre><code>$(input).change( function(){ var sum = $(input:checked).length var price_total = $(input:checked).length * 1.99 }) </code></pre> <h3>The Complication</h3> <p>The element or elements <em>being</em> changed are NOT counted in the above code. It seems that when clicking a blank checkbox to check it, jQuery will consider the current element 'not checked' rather than 'checked', i.e. it reflects the checkbox <em>before</em> the change. As a result, my code gets significantly more complicated to accept the changed items.</p> <p>Is there an elegant and simple way to get around this?</p>
javascript jquery
[3, 5]
5,217,374
5,217,375
how to change header info in mp3 file?
<p>Below are my queries.</p> <p>1.What information is there in header field of mp3 file?</p> <p>2.If i need to change like bitrate,length,is it possible to change programatically.</p> <p>3.Is it necessary that all mp3 contains id3 tag?</p> <p>4.is there anyway that if i change some info in mp3 file it cant be played and if i redo it can be played?</p> <p>regards, hitendrasinh gohil</p>
java android
[1, 4]
5,945,028
5,945,029
android remote server
<p>i'm building an android application which i want all the user of the application share information throw a php script located in my server. <br>for example: i have a google Map and i want see all my friend's location. each of my application's users will send his current position the the php script (the server) every numerous of seconds. <br>i want the php script to send back to each user, the locations of all his friends. what is the best way of doing it ?<br></p> <p>i thought of few and will be happy to get help starting them:<br> 1. should i only send requests to the server and in the same request get an answer in return which will include all my friend's position ?<br> 2. should i make it a 2 way communication (using sockets maybe?) and whenever the server gets an update he sends it to all users? (i don't even know how to start doing it..)<br> 3. if i'm using number 2, should i have some kind of event listener which will wait and see if there's a new message from the server ?<br></p>
java android
[1, 4]
6,010,923
6,010,924
Javascript confirm without code in code behind
<p>I have a page with dynamically added imagebuttons, and i want them to send a confirm when you click them(for deletion).</p> <p>Since they are dynamic i cant code anything in a .click event.</p> <p>Hows the best way to do this? check if true or false and then send it to a delete function in code behind with the control as parameter? or any other way?</p> <p>Thanks</p>
javascript asp.net
[3, 9]
1,633,029
1,633,030
javascript: is it possible to embed a script if it isn't already defined?
<p>I'm having an issue where I have a page with a bunch of user interface based tabs. When a particular tab gets hit, an HTML form gets retrieved via XHR. That form has JavaScript embedded in it, some jQuery ajax form handlers, etc. Works fine and everything the first time the form is submitted. On subsequent submissions however, I get an error that looks like the following:</p> <pre><code>jQuery is not defined [Break on this error] jQuery( function( $ ) { </code></pre> <p>I'm not sure how this is happening, but when the form gets pulled back in, with the same exact JavaScript and jQuery handlers on subsequent submits, the error happens. Most browsers show the error, but handle it fine and the form continues to work. The wonderful IE6 however, displays an annoying dialogue box, so I need to fix this. It's as if jQuery isn't defined on subsequent submissions.</p> <p>Any suggestions?</p>
javascript jquery
[3, 5]