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 |
---|---|---|---|---|---|
1,251,183 | 1,251,184 |
ASP Chart with multiple X axis columns
|
<p>I have an SQL table with two columns, salesperson and status. The status can be one of three things, gold, silver and bronze.</p>
<p>How do I go about creating a chart where the salesperson name appears once along the x-axis but has three columns above their name for a count of each status?</p>
<p>Thanks,
Jonno</p>
|
c# asp.net
|
[0, 9]
|
1,572,136 | 1,572,137 |
jquery search each table row for a particular td
|
<p>Consider there's a table with rows to which a <code>td</code> with class <code>x</code> is added by jqeury on the fly (during DOM manipulation). Later when the user sumbit's this table (table being part of a form), i want to search all the rows for existence of this particular <code>td</code>. If this <code>td</code> is found then the function should return false, else true. However this piece of code does not work, any suggestions?</p>
<pre><code>function validate(){
$('form#newuser table tr').each(function(){
if($(this).find('td.x')){
return false;
}
});
return true;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,741,598 | 1,741,599 |
Passing additional arguments into the OnClick event handler of a LinkButton using Javascript
|
<p>I have a ASP.NET Website, where, in a GridView item template, automatically populated by a LinqDataSource, there is a LinkButton defined as follows:</p>
<pre><code><asp:LinkButton ID="RemoveLinkButton" runat="server" CommandName="Remove"
CommandArgument='<%# DataBinder.GetPropertyValue(GetDataItem(), "Id")%>'
OnCommand="removeVeto_OnClick"
OnClientClick='return confirm("Are you sure?");'
Text="Remove Entry" />
</code></pre>
<p>This works fine. Whenever the Button is Clicked, a confirmation dialog is displayed.</p>
<p>What I am trying to do now, is to allow the user to enter a reason for the removal, and pass this on the the OnClick event handler. How would I do this?
I tried <code>OnClientClick='return prompt("Enter your reason!");'</code>, but, of course, that did not work =)</p>
|
asp.net javascript
|
[9, 3]
|
6,028,441 | 6,028,442 |
Cost of creating objects in JavaScript/JQuery
|
<p>Could someone please compare and contrast between the costs of creating objects in JavaScript/JQuery and a simple variable declaration? </p>
<p>For Example:</p>
<pre><code>var G = {}
G.obj = (function(){
var x = 10; //'private' attribute, can be accessed internally only
G.y = 20; //'public' property
});
</code></pre>
<p>x obviously has a local scope where as Y would be accessible publicly through <strong>G</strong> with a selector. Are there any significant overheads involved in the latter approach? </p>
<p>Thanks.</p>
<p>Edit: I realize this might sound like a silly question but I am planning an architecture for an HTML5 game, I have to keep little things like these in mind as I move forward.</p>
|
javascript jquery
|
[3, 5]
|
2,288,454 | 2,288,455 |
Listview with image from the gallery
|
<p>I have a 'contacts' application within my app and I would like to be able to set an image against a persons name within the listview. </p>
<p>How can I select a picture from the gallery and set this as the image? I've seen loads of examples where the image is loaded into an array but I don't believe this is what I'm looking for.</p>
|
java android
|
[1, 4]
|
3,005,022 | 3,005,023 |
categorization of location to
|
<p>how to categorized location such as office, school etc from address,
For example.
my address is "gigaspace IT park,vimannagar,pune"
How to infer "office" from address.
Is there any model or any text or algorithm available or calculation from the address i need to do that.</p>
|
java android
|
[1, 4]
|
3,403,673 | 3,403,674 |
Passing JavaScript Variables to PHP Session
|
<p>Why I do not get any printing on the screen (m1, m2 or m3)?</p>
<p>i.e. how can I pass JavaScript var to PHP Session. </p>
<pre><code><?php session_start(); ?>
<html>
<head>
<script type="text/javascript">
function disp_text()
{
var p = document.myform.mylist.value;
<?php $_SESSION['color'] ?> = p;
<?php echo $_SESSION['color'] ?>;
}
</script>
</head>
<body>
<FORM NAME="myform">
<SELECT NAME="mylist" onChange="disp_text()">
<OPTION VALUE="m1">Red
<OPTION VALUE="m2">Blue
<OPTION VALUE="m3">Green
</SELECT>
</FORM>
</code></pre>
<p>
</p>
<p>Thanks for any help.</p>
|
php javascript
|
[2, 3]
|
1,248,799 | 1,248,800 |
Object identity in JavaScript
|
<p>How to check that two variables point to the same object? Meaning that if I mutate it—the value pointed to by both variables will change. In Python there is <code>is</code> operator, what about JavaScript?</p>
|
javascript python
|
[3, 7]
|
4,957,129 | 4,957,130 |
Clear text inside DIV
|
<p>I'm using the following HTML structure:</p>
<pre><code><div id="clock">5:30 AM
<div id="day">Wednesday
</div>
<div id="date">14 December
</div>
</div>
</code></pre>
<p>I update the contents of these elements using Javascript. For "day" and "date" I use <code>$("#day").text(day)</code> and <code>$("#date").text(date)</code>. Because "clock" is a parent element I had to use <code>$("#clock").prepend(clock)</code> to succesfully add the text.</p>
<p>The problem with the latter function, is that new text is prepended every time the clock is refreshed, i.e. it builds up a list of clock times. For the first two functions the text is just replaced, like it should. Is there a way to make this happen for the "clock" function as well?</p>
<p>EDIT: Sorry, should have been a bit more clear about the clock. Have edited the code, so you understand. BTW, the reason the clock is parent element is that could make the other two elements depend on the clock's position and styling.</p>
<p>I also created a jsFiddle: <a href="http://jsfiddle.net/KeyMs92/NZtFA/" rel="nofollow">http://jsfiddle.net/KeyMs92/NZtFA/</a>
I left the list building thing (annoyingly) in!</p>
<p>BTW, I'm not too sure if <code>function(); setInterval('function()', 1000)</code> is the best way to refresh, so if you something better I'd be happy to know :)</p>
|
javascript jquery
|
[3, 5]
|
353,049 | 353,050 |
why use AlternatingItemTemplate on listview
|
<p>why use AlternatingItemTemplate on listview and copy code from ItemTemplate to AlternatingItemTemplate?
i can't see logic? You can alternate with css too...</p>
|
c# asp.net
|
[0, 9]
|
2,580,256 | 2,580,257 |
Why should I learn C#?
|
<p>I want to know why I should learn C#? </p>
<p>What features does C# have that Java does not?</p>
|
c# java
|
[0, 1]
|
2,223,757 | 2,223,758 |
JQuery event.stopPropagation() not working
|
<p>In my html I have a span of class dragHandle embedded within a li. </p>
<pre><code><div class='treeView'>
<ul class='tree'>
<li><span class="dragHandle"></span>Item 1
<ul>
<li><span class="dragHandle"></span>Item 2 <a href="#">link</a></li>
</ul>
</li>
</ul>
</code></pre>
<p>I attach event handlers using jQuery as follows: </p>
<pre><code>$(".tree li").click(function(event) {
alert("click");
event.stopPropagation();
});
$(".dragHandle").mousedown(function(event) {
alert("down");
event.stopPropagation();
});
$(".dragHandle").mouseup(function(event) {
alert("Up");
event.stopPropagation();
});
</code></pre>
<p>When I mousedown and mouse up over the element I get the down and up alerts, however I also get the click alert of the li's event handler too. I thought that this should be prevented from by the call to event.stopPropagation in the mousedown and mouseup handlers. How do I stop the click event being called for mousedown/up events on the dragHandle?</p>
<p>TIA,
Adam</p>
|
javascript jquery
|
[3, 5]
|
3,878,595 | 3,878,596 |
Grab innertext from an anchor serverside
|
<p>How can I grab the <code><a></code> inner text? Are there any HTML helpers for this to work serverside with ASP.NET webforms? (this is not an MVC app)</p>
<pre><code>Method()
{
string trackingNumber = Database.GetTrackingNumber();
ExtractText(trackingNumber);
}
string GetTrackingNumber()
{
return "<a href=\"#\">TextINeedToExtract</a>"
}
ExtractText(string someHtml)
{
//need good way to get innerHtml for the <a>. HTML is not well formed.
}
</code></pre>
<p><strong>Update</strong><br />
I am trying to avoid adding more package dependencies. Can jquery be used serverside to handle this situation?</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
3,396,711 | 3,396,712 |
Handling multilanguage with JQuery only
|
<p>I use JQuery in my web app and I am wondering what the best way to handle multilanguage in that context is.<br>
I was thinking of creating a file like:</p>
<pre><code>label["login"]["fr"]="Connection"
label["login"]["en"]="Login"
</code></pre>
<p>Once the file is loaded I will then do (for each label) a:</p>
<pre><code>$('#login').text(label["login"][selected_language]);
</code></pre>
<p>In HTML I would then use: </p>
<pre><code><a href="login.html"><span id="login"></span></a>
</code></pre>
<p>Is this a correct way to do ?</p>
|
javascript jquery
|
[3, 5]
|
2,971,790 | 2,971,791 |
I want to share image on facebook wall which i have already uploaded in image folder
|
<p>How to share image on facebook wall by getting path from image folder in asp.net c#.
That means, image that is in image folder,i want to share this image.</p>
|
c# asp.net
|
[0, 9]
|
2,346,823 | 2,346,824 |
regular expression check if number is whole number or float i think
|
<p>Hi all I need an if and else statement that checks if two fields which are min and max are numbers and these numbers can be whole numbers like 0 or 12 or they could be 0.50 to 1,300.99 does anyone know how to check for numbers my code is in the following format:</p>
<p>jQuery:</p>
<pre><code>$(document).ready(function(e) {
$('#price_range').click(function(e) {
var price_min = $('#min').val();
var price_max = $('#max').val();
var error_msg = "";
if(price_min.macth(.../) && price_max.match(.../)) {
error_msg = "Please enter a valid number."
}else if(price_min > price_max) {
error_msg = "Min is greater than max."
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
579,723 | 579,724 |
Jquery Rollovers, issue with click state
|
<p>Excuse my noobiness when it comes to Jquery, but I have some jquery code that does rollovers for me:</p>
<pre><code>$("img.rollover").hover(function () {
this.src = this.src.replace("_off","_on");
},
function () {
this.src = this.src.replace("_on","_off");
});
</code></pre>
<p>Essentially just switching the images from image_on.jpg to image_off.jpg on hover on a bunch of images, now on click i would like to set the state of "image_on" permanently but the hover state seems to overwrite it and it doesn't stay "_on", i'm guessing it something to do with binding of events? I also don't seem to be able to do it so if a user clicks on one image it sets it to on, but if they click another image to return the previous image to the "_off" state and set the current one to the "_on" state.</p>
<p>Any help appreciated, ta.</p>
|
javascript jquery
|
[3, 5]
|
2,524,917 | 2,524,918 |
creating checkbox in Asp.Net
|
<p>I created a gridview control editmode but now I want to create a checkboxlist and save values in database. How do I to create CheckBoxlist in a gridview editmode?</p>
|
c# asp.net
|
[0, 9]
|
3,711,814 | 3,711,815 |
Jquery .each() - return value undefined
|
<p>Why getColorOptionSelect() return undefined value (I'm sure it has a value by debugger ).</p>
<p>It is for sure an issue related to the scope, sorry for my js ignorance </p>
<pre><code>jQuery(document).ready(function () {
colorSelectID = getColorOptionSelect();
alert(colorSelectID);
function getColorOptionSelect() {
// get label
var selId;
jQuery(".product-options dl label").each(function () {
el = jQuery(this);
// lower case, remove *
var labelText = el.text().toLowerCase().replace("*", "");
if (labelText == 'color') {
//return element
selId = el.parent().next().find("select").attr('id');
return selId;
}
});
// return null;
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
361,190 | 361,191 |
jQuery $('form').serialize() returns only one element of a form serialized
|
<p>Given the following form:</p>
<pre><code><form id="form" name="form">
<input name="name"/>
<input name="version"/>
<input name="template"/>
<textarea name="elements"></textarea>
<textarea name="features"></textarea>
<textarea name="layout"></textarea>
<input type="submit" value="Save"/>
</form>
</code></pre>
<p>and javascript (using jQuery 1.3.2):</p>
<pre><code>$(function() {
$('#form').bind('submit',function() { alert($('#form').serialize()); return false; });
});
</code></pre>
<p>The output of submitting the above form from the above javascript alert is:</p>
<pre><code>elements=...
</code></pre>
<p>Where ... is whatever is contained in the elements field.</p>
<p>I would expect that $('#form').serialize() to return a string something like:</p>
<pre><code>name=&version=&template=&elements=&features=&layout=.
</code></pre>
<p>I do note that $('input,textarea').serialize() <strong>does</strong> perform the expected behaviour (i.e. return "name=&version=&template=&elements=asdafe&features=&layout="), however I'm curious as to why the $('#form') version only returns "elements=".</p>
<p>I've tried this on Safari 4 and Firefox 3.5, so I'm confident it's something I'm missing.</p>
<p>Thanks for reading.</p>
|
javascript jquery
|
[3, 5]
|
5,018,494 | 5,018,495 |
Uncaught ReferenceError when executing on different computer
|
<p>The below script works fine on one of my computers but when executing it on another I get <code>uncaught referenceerror $ is not defined</code>. It is the same error on another similar page. Also it says unable to load resource of the ajax.google... source.</p>
<pre><code><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
//add dynamic fields to add more addresses
$(document).ready(function() {
$('#btnAdd').click(function() {
var $address = $('#address');
var num = $('.clonedAddress').length;
var newNum = new Number(num + 1);
var newElem = $address.clone().attr('id', 'address' +
newNum).addClass('clonedAddress');
//set all div id's and the input id's
newElem.children('div').each (function (i) {
this.id = 'input' + (newNum*11 + i);
});
newElem.find('input').each (function () {
this.id = this.id + newNum;
this.name = this.name + newNum;
});
if (num > 0) {
$('.clonedAddress:last').after(newElem);
} else {
$address.after(newElem);
}
$('#btnDel').removeAttr('disabled');
if (newNum == 2) $('#btnAdd').attr('disabled', 'disabled');//number of
field sets that can be added
});
$('#btnDel').click(function() {
$('.clonedAddress:last').remove();
$('#btnAdd').removeAttr('disabled');
if ($('.clonedAddress').length == 0) {
$('#btnDel').attr('disabled', 'disabled');
}
});
$('#btnDel').attr('disabled', 'disabled');
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,784,306 | 1,784,307 |
What is the equivalent of header('Refresh: 2, blah.php') in jquery
|
<p>I wonder if there is an equivalent code or any function of jquery that should replace the <code>header('Refresh: 2, blah.php')</code> in php</p>
<p>I tried <code>window.location.href = "blah.php"</code> but doesnt satisfy my needs,..,
I want that after clicking the link it should pause a sometime then redirects,.,.
Is there any way out,.thank you!!!</p>
|
php jquery
|
[2, 5]
|
548,332 | 548,333 |
Using jQuery to check boxes based on user input (to another check box)
|
<p>This is a very simple use of jQuery that I can't get working.</p>
<p>When one check box is checked, I'd like the other to become checked.</p>
<p><strong>HTML:</strong></p>
<pre><code><input onchange="toggleRegion()" id="ESARO" type="checkbox" class="region"
value="ESARO" name="ESARO">ESARO
<br /><br />
<input type="checkbox" class="country" value="Afghanistan" name="country2"
/>Afghanistan
</code></pre>
<p><strong>jQuery:</strong></p>
<pre><code>function toggleRegion() {
if ($('#ESARO').is(':checked')) {
$('input[value="Afghanistan"]').attr('checked', true);
}
}
</code></pre>
<p><strong>jsfiddle:</strong></p>
<p><a href="http://jsfiddle.net/jsJU8/" rel="nofollow">http://jsfiddle.net/jsJU8/</a></p>
<p><strong>What I've tried:</strong></p>
<p>I have another function which does a very similar thing for a group of check boxes by class which works perfectly:</p>
<pre><code>function toggleStatus() {
if ($('#TLO1').is(':checked')) {
$('.country').attr('checked', true);
}
}
</code></pre>
<p>So I presume that the error lies in the selection of the element by value, rather than by class, as this is the only difference between the functions.</p>
<p>To this end I've tried adjusting that selector;'s syntax to match various examples I've found (single quote, double quote, no quote etc) but haven't had any luck.#</p>
<p>Although I note that it may be a possible error that I'm using javascript (onChange) to call a jQuery function. Is that an issue?</p>
<p>All help greatly appreciated - thank you</p>
|
javascript jquery
|
[3, 5]
|
2,913,960 | 2,913,961 |
advice on how to create dynamic controls
|
<p>My web page will get a set of results from the database and display it to the user. However I am not sure about "number" of results.</p>
<p>Each result will have a panel which contains several controls in itself, an image, several labels, etc.</p>
<p>What is the best way to do this dynamically, eg. create these controls dynamically?</p>
<p>Is it better to use an AJAX control? Should I use Gridview?</p>
<p>Thanks for the help,
Behrouz</p>
|
c# asp.net
|
[0, 9]
|
4,170,321 | 4,170,322 |
Getting id then selecting that element - jQuery
|
<p>I'm often finding myself getting various attributes, such as the id of an element or class, then selecting that element and doing something.</p>
<p>What I do now for example is:</p>
<pre><code> var id = $(this).closest(".item").attr('id');
$('#'+id).hide();
</code></pre>
<p>Is using '#' and including the id the best way to do this? is there a way to maybe chain these actions together? </p>
<p>Thank you!</p>
|
javascript jquery
|
[3, 5]
|
3,705,345 | 3,705,346 |
how to insert value in input, with javascript
|
<p>So I tried to do something like this -</p>
<pre><code>$('#price').val(price);
</code></pre>
<p>price is 300, and it shows good on browser, in input field, but when I want to take it out and mail it with PHP, in $_POST['price'] it doesn't show up, How can I insert something in inputs value with JavaScript, so I can mail it? It seems this is not an insertion in value, but just a feature to display something, correct?</p>
|
javascript jquery
|
[3, 5]
|
278,635 | 278,636 |
Call js-function using JQuery timer
|
<p>Is there anyway to implement a timer for JQuery, eg. every 10 seconds it needs to call a js function. </p>
<p>I tried the following</p>
<pre><code>window.setTimeout(function() {
alert('test');
}, 10000);
</code></pre>
<p>but this only executes once and then never again. </p>
|
javascript jquery
|
[3, 5]
|
3,427,089 | 3,427,090 |
How to automate a click on page load?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7943287/auto-click-on-page-load">Auto click on page load</a> </p>
</blockquote>
<p>I need to click on the specified xy position on a page without clicking it using a mouse. I have tried many jquery and js scripts, but they did not worked for me. I want an equivalent to manual mouse click. Is it possible? I am a beginner in js and jquery.</p>
|
javascript jquery
|
[3, 5]
|
4,709,470 | 4,709,471 |
Which JavaScript function is compatible with PHP urldecode function?
|
<p>On the server side the PHP code will be using <code>urldecode()</code> function to decode, but the JavaScript code is responsible to encode the URL. Which of the following JavaScript function is compatible with the PHP <code>urldecode()</code> function:</p>
<blockquote>
<ul>
<li>escape() </li>
<li>encodeURI() </li>
<li>encodeURIComponent()</li>
</ul>
</blockquote>
|
php javascript
|
[2, 3]
|
2,272,607 | 2,272,608 |
Access page controls in jquery
|
<p>I have a web application in VS 2008. I used jquery for validation of different Forms and used it for other purposes. In VS 2008 I get the IDs of page controls in jquery like Ctl001_.... , but now I have upgraded the application to VS 2010 and now all my page controls are giving error in jquery because its changed its ID there as ContentBody_....., I can not convert all these to the new prefix ContentBody_.... because on the server my project runs on .Net Framework 3.5 and there the IDs are with the Prefix of Ctl001_....,
can any one tell me a way that I can easily get control's ID in jquery without depending on the .Net Framework.</p>
<p>any help would be greatly appreciated.</p>
|
jquery asp.net
|
[5, 9]
|
1,322,960 | 1,322,961 |
PHP echo return confirm function slashes
|
<p>Hi i have been using this php echo statement </p>
<pre><code>echo "<a href = 'message_delete_script_outbox.php?id=".$row['id']."'"."onclick='return
confirm(/Are you sure, you want to delete?/)'>Delete</a>";
</code></pre>
<p>The statement is working i am seeing this message /Are you sure, you want to delete?/ instead of this Are you sure, you want to delete?</p>
|
php javascript
|
[2, 3]
|
686,140 | 686,141 |
check if value exists in 2D array
|
<p>I have a 2d array in the format</p>
<pre><code>emi_309 | present | weak | 6
emi_310 | present | strong | 9
emi_319 | present | medium | 8
emi_315 | present | weak | 5
</code></pre>
<p>I want to check if a value exists in the first column using a simple function</p>
<p>E.g, check if emi_77 exists in the first column</p>
<p>I came across <code>$.inArray(value, array)</code> but this function is for a 1d array only.</p>
<p>Is there something similar for 2d array</p>
|
javascript jquery
|
[3, 5]
|
5,968,593 | 5,968,594 |
Android Gmail App fails to attach my CSV file
|
<p>The following code works when I attach my csv file to the default email application on android, but does not work when I attach that same file to the gmail application. Does anyone have a solution for the gmail problem?</p>
<pre><code>Resources res = getResources();
FileOutputStream outPut;
try {
outPut = getApplicationContext().openFileOutput("IPAddressPlanner.csv", Context.MODE_WORLD_READABLE);
SendMail.createCSVAttachment(outPut, res, values_subnet, values_mask, values_inverse, values_subnet_size, values_host_range, values_broadcast);
File F = getApplicationContext().getFileStreamPath("IPAddressPlanner.csv");
Uri U = Uri.fromFile(F);
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822"); // use from live device
i.putExtra(Intent.EXTRA_SUBJECT, "IPV4 Address Information");
i.putExtra(Intent.EXTRA_STREAM, U);
startActivity(Intent.createChooser(i,"Select email application."));
} catch (FileNotFoundException e) {
Log.e(TAG, e.getMessage());
}
</code></pre>
|
java android
|
[1, 4]
|
3,778,644 | 3,778,645 |
Using jQuery, how do I change the elements html value? (div)
|
<p>Using a ajax request I want to change content of my div.</p>
<pre><code><div id="d1">202</div>
</code></pre>
<p>So I want to change the content to a different number.</p>
<pre><code>$('d1').InnerText???
</code></pre>
<p>Also, say I wanted to increment the number, how could I do that? Do I have to convert to int?</p>
|
javascript jquery
|
[3, 5]
|
1,146,770 | 1,146,771 |
jquery image slider gallery
|
<p>I'm trying to add images dynamically im my preview element.So when I click a thumbnails image will load and slide.</p>
<pre><code><div id="imageGallery">
<div id="loading"></div>
<a class="thumbnail"><img alt="Image 1" src="../../baContent/image1.jpg" /></a>
<a class="thumbnail"><img alt="Image 2" src="../../baContent/image2.jpg" /></a>
<div id="preview">
<img id="mainImage" alt="Main Image" src="../../baContent/image1.jpg" />
</div>
</div>
$(document).ready(function () {
$("#loading").show();
var oldImage = $("#preview img:first");
var newImage = $("#mainImage").insertAfter(oldImage).css('position', 'absolute').css('left', 800);
newImage.load(function () {
$("#loading").hide();
oldImage.css({ left: 0 }).animate({ left: -800 });
newImage.css({ left: 800 }).animate({ left: 0 });
oldImage.remove();
});
});
</code></pre>
<p>My idea is to insert image dynamically after the first image and old image will remove. I try to many functions append,insertTo. But it is not working.Thanks advice :)</p>
|
javascript jquery
|
[3, 5]
|
3,156,888 | 3,156,889 |
Posting and validating a PHP array using jQuery/AJAX
|
<p>I have a form that I am trying to post to php using jQuery ajax, and it needs to be validated first.</p>
<p>The field looks like this:</p>
<pre><code><select name="inquirymodule[]" id="inquirymodule[]">
<option value="" selected>Select an Inquiry Module</option>
<option value="1">Module 1</option>
</select>
</code></pre>
<p>Additional selectors can be added with jQuery to allow as many selections to be made as needed, and all values posted in the inquirymodule variable.</p>
<p>I have read elsewhere that I think I can post this variable using the value </p>
<pre><code>jQuery('#inquirymodule').serialize()
</code></pre>
<p>But I have validation running on the select, to make sure something is selected before it is submitted. Prior to making this an array variable, this worked:</p>
<pre><code>jQuery('#inquirymodule').bind('change', function (event) {
wizard.validate(true);
});
</code></pre>
<p>However I know that adding '<code>[]</code>' to the variable name will break the javascript here.</p>
<p>Any advice?</p>
|
php jquery
|
[2, 5]
|
971,816 | 971,817 |
Working on a memory matching game - can you display one image in different ways?
|
<p>I'm working on a memory matching game. Right now, the game is working fine. However, I now need to work on the part of the game where you actually have to flip the cards over. I first was going to have two sets of images: the "back of the card" and the "front of the card." The backs of the cards were all going to be identical and then when you click on one, the front of the card would be revealed. The fronts would all be unique pairs of pictures. However, my code is such that pictures that are clicked on which have the same source would be removed. So once you click on any two of the "backs" of the pictures, they would always be removed, regardless of what their "front" was. </p>
<p>I want to use only one set of pictures and just have them displayed differently when they are clicked. Sorry if that sounds a bit confusing, that's the best way I can explain it.</p>
<p>Here is a demo of what I have so far: <a href="http://jsfiddle.net/GquLr/" rel="nofollow">http://jsfiddle.net/GquLr/</a></p>
<p>So basically, I need a way to incorporate a feature where you have to flip two cards over and if they match, they are removed and if they don't match, they flip back over.</p>
|
javascript jquery
|
[3, 5]
|
1,612,576 | 1,612,577 |
Javascript: Glitch with function
|
<p>I'm currently trying to make the function below work correctly. Recently added the IF ELSE variables to it, and after the my script no longer works. If I remove it of course, everything goes back to normal, minus that feature of course. What am I doing wrong exactly? Thanks in advance!</p>
<pre><code>var image3 = $("#image3");
$(function() {
$("#ID-OF-LINK-1").click(function() {
$("#image1").attr("src","./image1.jpg");
$("#image2").attr("src","./image2.jpg");
if (image3.src != "./image3.jpg"){
("#image3").attr("src","./image4.jpg"); }
else
("#image3").attr("src","./image3.jpg"); }
})
})
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,086,246 | 3,086,247 |
Capture filled PDF form data
|
<p>I would like to capture filled PDF form data from public facing website and save it in the database on the server. Is it possible?Please let me know.</p>
|
c# asp.net
|
[0, 9]
|
2,301,169 | 2,301,170 |
jquery slidedown and hide issue
|
<p>Please check this code:</p>
<pre><code> var data = $(".others-involved-div-wrapper-tobe-copied").html();
data = '<div class="others-involved-div-wrapper" >'+data+'</div>';
$(".others-involved-div-wrapper:last").after(data).slideDown("slow");
if ($(".others-involved-div-wrapper").length > 1){
$(".others-involved-div-wrapper:last .delete-more-others-involved").show();
}
</code></pre>
<p>Here the slideDown effect is not working.
The data is not seen if I do display none in div</p>
<pre><code>data = '<div class="others-involved-div-wrapper" style="display:none;" >'+data+'</div>';
</code></pre>
<p>If I'm doing <code>data = data.hide();</code> ,Its showing error hide is not a function.</p>
<p>I just need slidedown effect when that data value is appended.</p>
|
javascript jquery
|
[3, 5]
|
1,039,237 | 1,039,238 |
What is the jQuery equivalent for this method
|
<p>I need to know how would you call <code>document.body.innerText;</code> and <code>document.body.innerHTML;</code> in jQuery. How does jQuery handle javascript methods that start with document.body...</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,044,423 | 2,044,424 |
External JS file not finding controls, but work with quickwatch
|
<p>I have the following code in my aspx file:</p>
<pre><code>var blah = "<%= lblErrorsMain.ClientID %>"
</code></pre>
<p>and here is the external js file:</p>
<pre><code>function ShowShowScans2() {
oWebDialogWindow2 = document.getElementById(blah);
oWebDialogWindow2.set_windowState($IG.DialogWindowState.Normal);
return false;
}
</code></pre>
<p>When the code runs, it always bombs out at the oWebDialogWindow2.set_windowState($IG.DialogWindowState.Normal) that Microsoft JScript runtime error: Unable to get value of the property 'set_windowState': object is null or undefined.
When I break into the code and hover over oWebDialogWindow2, it's null. But, when I open a quickwatch window and do document.getElementById(blah), I get access to the object. What is going on?</p>
|
javascript asp.net
|
[3, 9]
|
5,122,350 | 5,122,351 |
How can I get the width of the browser in pixels using JavaScript?
|
<p>I want to set the width of an <code><iframe></code> based on the browser's width and height.</p>
<p>Is it possible to get the browser's width in pixels using JavaScript?</p>
|
javascript jquery
|
[3, 5]
|
4,238,404 | 4,238,405 |
String extraction with javascript
|
<p>I'm using jquery and have an entire html page stored in <code>var page</code></p>
<pre><code>var page = '<html>...<div id="start">......</div><!-- start -->....</html>';
</code></pre>
<p>How can I extract only the section that starts with <code><div id="start"></code> all the way to after the end tag <code></div><!-- start --></code> such that my output is</p>
<pre><code><div id="start">......</div><!-- start -->
</code></pre>
|
javascript jquery
|
[3, 5]
|
777,742 | 777,743 |
Defining Types on Class declaration?
|
<p>Im relatively new to Java, and I recently came across a syntax that I have never seen before.</p>
<pre><code>public class loadSomeData extends AsyncTask<String, Integer, String>{ etc..}
</code></pre>
<p>The part that confuses me is the stuff between the <> brackets. I understand what each of the Types are used for in this class, but why declare them in the class declaration?</p>
<p>More specifically what is this: <code><DataType></code> called in Java so I can research it?</p>
<p>Thank you</p>
|
java android
|
[1, 4]
|
946,288 | 946,289 |
How to stop slide show hide text and image jumping on top while next slide come in?
|
<p>This Slide show is running perfect with image and text at same time, but the problem arise when you scroll at bottom and every time your next slide changes or come then its jumps on top, don't no why.</p>
<p>This is the reference link : <a href="http://new.kingspointcap.com/home" rel="nofollow">http://new.kingspointcap.com/home</a></p>
<p>and below is the js code:</p>
<pre><code> /*----------Slideshow of text------------*/
var faderIndex = 2, //to keep track, also it will start from 1st because last value is 0
faders = $('.fadeTxt'); //cache, so we won't have to walk the dom every time
function nextFade() {
//fade out element over 3000 milliseconds, after which call a function
$(faders[faderIndex]).fadeOut(6000, function () {
//increase the index and do a check, so we won't overflow
faderIndex++;
if (faderIndex >= faders.length)
faderIndex = 0;
//fade in the next element, after which call yourself infinitely
$(faders[faderIndex]).fadeIn(3000, nextFade);
});
}
//get the ball rolling
nextFade();
/*----------Slideshow of text------------*/
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,410,315 | 2,410,316 |
how to stop form submit in when in a ajax call
|
<p>i can only modify the code in the ajax call
a ajax call made when i click the submit in form named $('#form1')</p>
<pre><code>$('#form1').submit(function(){
$.ajax({
url:'some.php',
type:'POST',
data:somedata,
success:function(msg){
if(!msg){
//i wanna to stop form1 submit here,how to do that? you can only modify the code in the ajax call
}
}
})
})
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,040,355 | 4,040,356 |
Jquery loading Webpages
|
<p>Can I load external Website or Webpages into a DIV tag without using Jquery load(); function, since load() function is using AJAX. but apart from that is there any other simple way to loading Webpages </p>
|
javascript jquery
|
[3, 5]
|
1,527,150 | 1,527,151 |
Downloading and decompress a zip-file in the background?
|
<p>I need to download a zip file and unpack it, in the background (in an AsyncTask I'd imagine).</p>
<p>As it is now, I've got a DefaultHTTPClient set up, and a ZipInputStream ready to go, but here's where I am stuck - I have no idea how to use these two together. Here's the relevant code in the AsyncTask:</p>
<pre><code>DefaultHttpClient http = new DefaultHttpClient();
HttpGet method = new HttpGet("http://tf2b.com/downloads/imgshugo.zip");
//method.addHeader("Accept-Encoding", "gzip");
HttpResponse res = http.execute(method);
InputStream is = res.getEntity().getContent();
ZipInputStream zip = new ZipInputStream(is);
</code></pre>
<p>The last line there I'm not sure about at all, even. Any help would be appreciated!</p>
|
java android
|
[1, 4]
|
4,846,681 | 4,846,682 |
JQuery: zoom text on hover
|
<p>I want to zoom/unzoom a text with animate. The problem is that the text is absolutely positioned inside a relative div and when I animate the font-size the text expands only to the right and bottom. I want it to expand/retract to all sides equally.</p>
<p>Prepared example: <a href="http://jsbin.com/welcome/48103/edit" rel="nofollow">http://jsbin.com/welcome/48103/edit</a></p>
|
javascript jquery
|
[3, 5]
|
3,677,211 | 3,677,212 |
Display the query result in many text boxes
|
<pre><code>msgid title body sendat
1 new this is body 11/11/2011
2 old ths is is 12/11/2011
</code></pre>
<p>I am doing a query and displaying the message with MSGID 1 in a grid
view. I want to display it in text boxes.</p>
<pre><code> title: new
body: this is body
sendat: 11/11/2011
</code></pre>
<p>How can this be done?</p>
|
c# asp.net
|
[0, 9]
|
4,162,187 | 4,162,188 |
What's the simplest & most efficient way of telling if your code is executing on the client or the server?
|
<p>I have an ASP.NET (C#) class that is used both on the client and server.</p>
<p>Depending on whether the code is being executed on the client or the server, it needs to behave differently.</p>
<p>What is the simplest & most efficient way of telling if the code is executing on the client or the server?</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
1,363,207 | 1,363,208 |
Page Directive Error After Copying Default.aspx From Another Project?
|
<p>In my web-application (asp.net, C#) in solution explore I copy and paste the default.aspx page which is in the other project. When I run the default.aspx page it is giving error like this</p>
<pre><code><%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="Default" %>
</code></pre>
<p>Parser Error Message: Could not load type 'Default'.</p>
<p>Can anyone tell me how to fix this?</p>
|
c# asp.net
|
[0, 9]
|
3,818,145 | 3,818,146 |
conditional statement specifying css property
|
<p>this is most likely very easy but i'm struggling</p>
<pre><code>$(window).bind("load resize", function(){
var wH = $(window).height();
var wW = $(window).width();
var hwH = (wH) / 2;
// ---- slide size w+h ----
$('.slide').css({'height': (wH) +'px', 'width': (wW) +'px'});
$('#features') .css({'height': (wH+hwH) + 'px'});
// ---- size/min-size for featureItem div's ----
$('.featureItem') .css({'height': (wH * 1.5) / 5 - 17 +'px'});
});// end resize.function
</code></pre>
<p>i would like to add a conditional statement for #features along the lines of</p>
<pre><code>if$(wH+hwH < 735) {
$('#features').css({'height': 735 +'px'});
}
else {
$('#features').css({'height': (wH+hwH) + 'px'});
}
</code></pre>
<p>thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
5,537,928 | 5,537,929 |
ASP.NET File Download problem
|
<p>In our application we often have a button that will perform a post back, get data, convert it into excel/PDF, and stream it to the client via Response.Write or Response.BinaryWrite. This works perfectly fine when we are in a popup or not.</p>
<p>We just implemented a new feature that creates a msg file. However, we are getting an error when streaming to the client (same code as before) - "Internet explorer cannot open this site". We redirect to another page with a query string parameter stating which file to get the bytes for and stream it to the client. </p>
<p>Has anyone experienced this before? This feature works fine on the dev machines but in staging (Server 2003, IIS 6) it's broken and throwing this error</p>
|
c# asp.net
|
[0, 9]
|
1,567,500 | 1,567,501 |
Why must I define a variable outside a javascript function definition? (jQuery / #anchor question)
|
<p>I am writing a jQuery function that relies on knowing the current #anchor of the page. I am using the jQuery URL Parser plugin to get the anchor.</p>
<pre><code> $.fn.vtabs = function() {
alert("Your anchor is "+$.url.attr('anchor'));
}
</code></pre>
<p>This code gives me the anchor "#nav" endlessly (I use #nav in some of the my links). I can type in "#newanchor" into the browser bar endless times, and click url's to this page that use different anchors, but always this code gives me "#nav".</p>
<p>I fixed my problem by changing the code to:</p>
<pre><code> var current_anchor = $.url.attr('anchor');
$.fn.vtabs = function() {
alert("Your anchor is "+current_anchor);
}
</code></pre>
<p>Now it always gives me the correct anchor. But I don't know why, and it appears messy to have that variable defined outside of the function.</p>
|
javascript jquery
|
[3, 5]
|
3,653,752 | 3,653,753 |
How to use c# code inside <% ... %> tags on asp.net page?
|
<p>I'm writing an asp.net user control. It has a property FurtherReadingPage, and controls: ObjectDataSource and a Repeater bound to it. Inside the Repeater I would like to display a hyperlink with a href property set to something like <em>FurtherReadingPage + "?id=" + Eval("Id")</em> and I don't know how to do it inside html code. I can use <% Eval("Id") %> or <% Response.Write(FurtherReadingPage + "?id=") %> alone but I don't know how to mix them.</p>
|
c# asp.net
|
[0, 9]
|
2,570,539 | 2,570,540 |
Hash sign in jQuery calls
|
<p>Being a pragmatic coder I tend to miss some obvious things and I wonder,
What's the difference between</p>
<pre><code>$('loc')
$('#loc')
</code></pre>
<p>The more info the better about the ins and outs of #</p>
|
javascript jquery
|
[3, 5]
|
4,441,422 | 4,441,423 |
how to toggle addClass and removeClass?
|
<p>my code:</p>
<pre><code><a href=# onclick="obj.addClass('fliph'); return false;">toggle</a>
</code></pre>
<p>i want click <strong>toggle</strong> to <code>obj.addClass('fliph')</code>,then click again run <code>obj.removeClass('fliph')</code>.</p>
<p>how to fix my code?</p>
<p>thanks all! :)</p>
|
javascript jquery
|
[3, 5]
|
5,293,559 | 5,293,560 |
Get me off the JavaScript postback Failboat
|
<p>I've got to call two js functions, setfocus on textbox and stop a postback from occuring on single buttonclick. I think I got it if I could only intercept the postback. My js skills are on par with weaksauce. </p>
<p><strong>test case</strong></p>
<pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JsTextFocus.aspx.cs" Inherits="WebApplication1.JsTextFocus" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" language="Javascript">
function aMethod() {
var dowork = 'bleh';
}
function setFocusOnTextBox() {
TextBox1.Focus();
return false;//Stop the postback..FAIL
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:ImageButton ID="imageBtn" runat="server" ImageUrl="images/document_Small.gif" CausesValidation="false" OnClientClick="aMethod();return setFocusOnTextBox();return false;" />
</div>
</form>
</body>
</html>
</code></pre>
<p><strong>Page load shouldn't fire after OnClientClick</strong></p>
<pre><code> protected void Page_Load(object sender, EventArgs e)
{
Response.Write("PS happened at " + DateTime.Now);
}
</code></pre>
|
javascript asp.net
|
[3, 9]
|
5,400,882 | 5,400,883 |
Write on html on load
|
<p>I have created a function who tracks on which slide I am currently on and display the result
e.g. If I am on slide 2 of 3 it will display 2/3</p>
<p>my problem is that right now it is set to do that every time I click the forward arrow but it displays nothing on page load.</p>
<pre><code>$('.forward').click(function() {
var current = $('#slider').data('AnythingSlider').currentPage; // returns page #
var count = $("#slider").children().length - 2;
$("#bottom-image").html(current + "/" + count) ;
});
</code></pre>
<p>I am trying to find out how to execute this function on page load and where to put it in my code. I am currently learning Javascript through Codecadamedy so I have a basic knowledge of Javascript but I am not enough fluent right now to figure this one out.</p>
<p>Here is a link to the current non working code : <a href="http://www.soleilcom.com/metacor_dev/our-plants.php" rel="nofollow">http://www.soleilcom.com/metacor_dev/our-plants.php</a></p>
|
javascript jquery
|
[3, 5]
|
924,859 | 924,860 |
What is the earliest and latest events that jquery can hook into?
|
<p>I've written a tiny plugin that gets the page load/render time. It collects the finish time at $(document).ready and I've put the code snippet that collects the start time right after the <code><title></code> tag. </p>
<p>I'd like this to be less obtrusive, so it seems there should be an earlier event than .ready where I can collect the earliest measurable page start time.</p>
<p>Here is the currently obtrusive javascript</p>
<pre><code><title></title>
<script type="text/javascript">
var startTime = (new Date()).getTime();
</script>
</code></pre>
<p>Here is the plugin:</p>
<pre><code>(function ($) {
$(document).ready(function () {
var endTime = (new Date()).getTime();
var millisecondsLoading = endTime - startTime;
$.get('hicmah.ashx?duration=' + millisecondsLoading, function (data) {
});
});
})(jQuery);
</code></pre>
|
javascript jquery
|
[3, 5]
|
602,004 | 602,005 |
How to validate multiple comma separated email id's in android?
|
<p>How can i validate multiple comma(,) separated email id's in android.I'm using below code for single email validation.Please can any one help me.</p>
<pre><code>static boolean validEmail(String str_newEmail) {
return str_newEmail.matches("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$");
}
</code></pre>
<p>Thanking in Advance.</p>
|
java android
|
[1, 4]
|
5,147,782 | 5,147,783 |
Simplifying onclick jquery/JavaScript functions
|
<p>I am trying to simplify all .js functions on the site to improve page load speed and overall performance of my site. Managed to do most of it on my own, but got stack when started to minimize couple of functions that are mostly call backs and onclick functions called from the functions.js in the page head.</p>
<p>SO here is my question, how can I make one function out of the following 2 to make script shorter and without loosing any functionality, or if there any alternative way to make it all simpler than it currently is?</p>
<pre><code>function user_dialog(dialog_content, download_button) {
if (typeof jQuery.ui != 'undefined') {
$("#dialog").attr("title", "Lets share it").html(dialog_content);
$("#dialog").dialog({
modal: false,
width: 400,
buttons: {
Cancel: function() {
$(this).dialog("close");
},
"Download": function () {
$(this).dialog("close");
window.location = download_button;
}
}
});
} else {
window.location = download_button;
}
}
function user_notice(link_source) {
download_link = $(link_source).attr("href");
$.ajax({
type: "POST",
url: "/includes/json.php",
data: "action=reminder&thepath=" + download_link,
dataType: "json",
error: function() {
window.location = download_link;
},
success: function(resp_dialog) {
if (resp_dialog.status == 1) {
user_dialog(resp_dialog.html, download_link);
}
}
});
}
</code></pre>
<p>Thanks for your help in advance!!!</p>
|
javascript jquery
|
[3, 5]
|
903,031 | 903,032 |
Can access a object after postback - ASP.NET
|
<p>I am really confused with this behavior. Can someone explain this to me?</p>
<p>I have the following class structure:</p>
<pre><code>public abstract BaseUserControl : System.Web.UI.UserControl
{
public List<string> listFieldMapper = new List<string>();
}
public partial class Property : BaseUserControl
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
base.listFieldMapper.Add("test");
}
}
</code></pre>
<p>In a event handler of a button, (causes Postback), I can access the <code>base.listFieldMapper</code></p>
<p>My understanding was that between postbacks, the state is not maintained, to be able to maintain the state, use the ViewState object. How is it that the list maintains the values?</p>
<p>On a side note, If I set the value of <code>base.listFieldMapper</code> after <code>OnInit</code> (Ex: Load), I have a null object after postback. </p>
|
c# asp.net
|
[0, 9]
|
2,253,166 | 2,253,167 |
Is there a way to use Java and PHP on the same Apache server or at least, same port?
|
<p>I am pretty new to Java for Web and my question is if I can use Java and PHP together? I know I can use them together, let's rephrase the question, is there a way to access them at the same port?</p>
<p>Java uses Tomcat, can PHP use tomcat also? </p>
|
java php
|
[1, 2]
|
6,016,303 | 6,016,304 |
How can I prevent a jquery animation from firing when a selectbox is active
|
<p>The following jsfiddle demonstrates the problem. In Firefox, hover over 'highlight stories' and try to select from the second drop-down: the containing ul animates closed and it is impossible to select an option. It is also possible to get into a flickering loop by selecting from the top select box and moving the mouse down slightly.</p>
<p>I can remove the mouseleave event by doing something like this:</p>
<pre><code>$('.selector').click(function(){
$('nav ul li').unbind('mouseleave');
});
</code></pre>
<p>But this obviously prevents the hover animation from firing correctly. Can anyone suggest a more elegant solution?</p>
<p><a href="http://jsfiddle.net/codecowboy/mDUa9/8/" rel="nofollow">http://jsfiddle.net/codecowboy/mDUa9/8/</a></p>
|
javascript jquery
|
[3, 5]
|
3,062,886 | 3,062,887 |
JavaScript minifier that strips out unused code
|
<p>Does anyone know of a JavaScript minifer that can detect unused code and strip it out.</p>
<p>Google Closure seems alright but it appears to only compact.</p>
<p>I'm looking for something much more advanced, where it can look through my JavaScript and not only compact but also remove unused code.</p>
<p>Anyone know of such a tool?</p>
<p>The use base being, I use very little functionality of JQuery - what I would like to do is remove from the base/core all the bloat that is unneeded from my use.</p>
|
javascript jquery
|
[3, 5]
|
1,059,424 | 1,059,425 |
How to know if the phone is charging
|
<p>i need to know (throught my app) if the Android device is charging. Any ideas? thanks</p>
|
java android
|
[1, 4]
|
3,518,742 | 3,518,743 |
Browse dialog for custom server control
|
<p>I have created a custom server control that inherits from Hyperlink. The output html after control is rendered is a nice looking css button with an icon.
For the icon I have a string property.</p>
<p>What i would like to do is on the source code to open "browse file dialog" for the icon similar to NavigateUrl property dialog see screen below </p>
<p><img src="http://i.stack.imgur.com/XKlOo.png" alt="enter image description here"></p>
<p>How this can be done? </p>
|
c# asp.net
|
[0, 9]
|
3,787,312 | 3,787,313 |
Open File Dialogue box in JavaScript
|
<p>how can I get an "open file dialogue" box in Javascript? ::)</p>
<p>Thanks in advance :)</p>
<p><strong>Edit:</strong> </p>
<p>Duplicate of: </p>
<p><a href="http://stackoverflow.com/questions/438650/open-file-dialogue-box-in-javascript">open-file-dialogue-box-in-javascript</a></p>
<p>and</p>
<p><a href="http://stackoverflow.com/questions/408735/javascript-file-uploads">javascript-file-uploads</a></p>
|
asp.net javascript
|
[9, 3]
|
3,211,192 | 3,211,193 |
Role based security with asp.net
|
<p>How to implement role based security in each page.</p>
|
c# asp.net
|
[0, 9]
|
417,889 | 417,890 |
I need help starting out with programming
|
<p>A couple of days ago, I began learning c++. I downloaded visual studio, looked at tutorials, and wrote some simple programs. I was doing good until I got the pointers. Whats the point of "pointing" to a variable when you can just reference the actual variable. It was really confusing me.</p>
<p>So I began looking online at other languages. I debated java, python, ruby, perl, c#, Visual basic, and I couldn't decide. I wanted to make something with a GUI, so everywhere I went, I got pointed to c#. I began looking at that, and it seems fine, but there is no way of working with "unlimited" sized variables.</p>
<p>So before I go too far into c#, is java a better choice? How about python? What language would be the best for general-purpose programming? </p>
<p>Thanks</p>
|
c# java python
|
[0, 1, 7]
|
5,285,081 | 5,285,082 |
How to Update Database Table after AjaxFileUpload ASP.NET
|
<p>The file is uploading to the corresponding path but table (fileinfo) is not updating..
How to achieve the table updation after a file is being uploaded to the server</p>
<pre><code> protected void UploadComplete(Object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
string str = RadioButton1.Text;
string path = Server.MapPath("~/" + str +"/") + e.FileName;
AjaxFileUpload1.SaveAs(path);
SqlConnection con = new SqlConnection("Data Source=localhost\\sqlexpress; Initial Catalog=example;user ID=sa;password=*******;");
con.Open();
string command1 = "insert into fileinfo(fileid,filename,date1) values(@fileid,@filename,@date1)";
SqlCommand command = new SqlCommand(command1, con);
command.Parameters.AddWithValue("@fileid", "101");
command.Parameters.AddWithValue("@filename", e.FileName);
command.Parameters.AddWithValue("@date1", DateTime.Now);
command.ExecuteNonQuery();
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
620,537 | 620,538 |
JDBC runs in pure Java, but not in Android
|
<p>This code <strong>runs OK</strong> in a pure Java application:</p>
<pre><code> Connection conn = null;
Statement inst;
try {
Class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance ();
conn = DriverManager.getConnection("jdbc:sqlserver://192.168.1.100\\MSSQLSERVER:1433;DatabaseName=Prueba", "sa", "sa1234");
inst = conn.createStatement();
inst.executeUpdate("INSERT INTO TIENDAS(NOMBRE) VALUES ('ZZZZZZZ') ");
} catch (Exception e) {
e.printStackTrace();
}
}
</code></pre>
<p>But in Android project I get the error <strong>'Socket closed'</strong>.</p>
<p>I'm using Eclipse Helios.</p>
<p>Can somebody help me?</p>
|
java android
|
[1, 4]
|
2,707,419 | 2,707,420 |
numerous similar AJAX suggestion boxes without ID's
|
<p>I have a search box on my site that uses autocomplete to give suggestions, and it works great. Now I want to use it on several INPUT fields on a single page. However, the script uses ID tags to access the contents of the INPUT form box. </p>
<p>I modified this:</p>
<p><code>$('#suggest').autocomplete(</code></p>
<p>to this:</p>
<p><code>$('.suggest').autocomplete(</code></p>
<p>How do I access the INPUT box text now that I lose the ability to use <code>getElementsById</code>?</p>
|
javascript jquery
|
[3, 5]
|
5,179,117 | 5,179,118 |
please help turn a simple Python2 code to PHP
|
<p>Sorry to bother again, but I really need help transforming this Python2 code into PHP.</p>
<pre><code>net, cid, lac = 25002, 9164, 4000
import urllib
a = '000E00000000000000000000000000001B0000000000000000000000030000'
b = hex(cid)[2:].zfill(8) + hex(lac)[2:].zfill(8)
c = hex(divmod(net,100)[1])[2:].zfill(8) + hex(divmod(net,100)[0])[2:].zfill(8)
string = (a + b + c + 'FFFFFFFF00000000').decode('hex')
data = urllib.urlopen('http://www.google.com/glm/mmap',string)
r = data.read().encode('hex')
print float(int(r[14:22],16))/1000000, float(int(r[22:30],16))/1000000
</code></pre>
<p>Would be great if someone could help, thanks in advance!</p>
<p>EDIT:</p>
<blockquote>
<blockquote>
<blockquote>
<p>I see. Can you edit your post to include what you've translated so far please. </p>
</blockquote>
</blockquote>
</blockquote>
<pre><code><?php
$net = 25002;
$cid = 9164;
$lac = 4000;
$a = '000E00000000000000000000000000001B0000000000000000000000030000'
$b = hex($cid)[2:].zfill(8) + hex($lac)[2:].zfill(8)
$c = hex(divmod($net,100)[1])[2:].zfill(8) + hex(divmod($net,100)[0])[2:].zfill(8)
$string = ($a + $b + $c + 'FFFFFFFF00000000').decode('hex')
$data = 'http://www.google.com/glm/mmap'.$string
$r = $data.read().encode('hex')
print float(int($r[14:22],16))/1000000, float(int($r[22:30],16))/1000000
?>
</code></pre>
|
php python
|
[2, 7]
|
5,130,154 | 5,130,155 |
Logon failure error when attempting UserPrincipal.FindByIdentity
|
<p>I've been searching for solutions on this for a while now, but each thread a dead-end unfortunately.</p>
<p>I'm working on a C#/ASP.net web app that will only be used internally by our company. Anonymous access has been switched off both in IIS and my web.config file forcing IIS to use the windows authenticated user (Active Dir user).</p>
<p>My problem is that the following code works perfectly to get the required (or any) AD user: </p>
<pre><code>using System.DirectoryServices.AccountManagement;
... other code ...
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "mydomain", "someADuser", "someADuserpassword");
UserPrincipal winuser = UserPrincipal.FindByIdentity(ctx, IdentityType.SamAccountName, "samaccountname");
</code></pre>
<p>"someADuser" used in the PrincipalContext above is the current logged in user through windows, thus authenticated and a valid AD user. Using the following code (with the exact same user still logged in) gives me a "Logon failure: unknown user name or bad password" error:</p>
<pre><code>PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "mydomain");
UserPrincipal winuser = UserPrincipal.FindByIdentity(ctx, IdentityType.SamAccountName, "samaccountname");
</code></pre>
<p>It seems UserPrincipal.FindByIdentity doesn't use the logged in user's validated credentials for some reason if it's not specified in the PrincipalContext object - something I don't want to do.</p>
<p>Is it possible that the ctx aren't picking up the logged in Windows users for some reason, even if the necessary settings (i hope) is added to web.config :</p>
<pre><code><authentication mode="Windows"/>
<authorization>
<deny users="?"/>
</authorization>
</code></pre>
<p>And Anonymous access is completely disabled in IIS?</p>
|
c# asp.net
|
[0, 9]
|
4,356,852 | 4,356,853 |
Getting the clicked element using $(this)
|
<p>hey I have this silly issue and I hope you could help me to solve it. I have some "a" elements and I just want to add an active class when clicked.</p>
<p>I tried this :</p>
<pre><code><a href="javascript:mifunction()"></a>
js:
function mifunction(){
$(this).addClass('active');
}
</code></pre>
<p>but it doesn't work, so I tried this:</p>
<pre><code><a></a>
js:
$('a').click(function() {
$(this).addClass('active');
});
</code></pre>
<p>It doesn't work either. It just worked when I mixed both. But users have to dubbleclick the element, which is not an option:</p>
<pre><code><a href="javascript:mifunction()"></a>
js:
function mifunction(){
$('a').click(function() {
$(this).addClass('active');
});
}
</code></pre>
<p>Do you have any idea of how to solve this?</p>
<p>Thank you very much!</p>
|
javascript jquery
|
[3, 5]
|
1,987,536 | 1,987,537 |
Enable Dynamic TextBox with Dynamic checkbox checked event
|
<p>I am adding 2 controls Checkbox1 and Textbox1 dynamically. Textbox1 has been disabled by default. I want to enable Textbox1 if checkbox1 is checked. Thanks in Advance.</p>
<p>Praveen</p>
|
c# asp.net
|
[0, 9]
|
598,129 | 598,130 |
jQuery add not working with HTML
|
<p>In the <a href="http://api.jquery.com/add/" rel="nofollow">jQuery <code>add</code> documentation</a>, it lists an <code>add(html)</code> overload which describes the <code>html</code> argument as:</p>
<blockquote>
<p>An HTML fragment to add to the set of matched elements.</p>
</blockquote>
<p>Since there is already an <code>add(element)</code> overload, I assume this means that you pass it an HTML string, as in:</p>
<pre><code>var set = $();
set.add("<div></div>");
document.write(set.length); // prints 0
</code></pre>
<p>However, <a href="http://jsfiddle.net/s2zQr/" rel="nofollow">when this code is run</a>, it has no effect on the jQuery wrapped set. What am I missing?</p>
|
javascript jquery
|
[3, 5]
|
4,099,800 | 4,099,801 |
Any free tool to convert java to javascript
|
<p>Is there any free tool to convert java into javascript?</p>
<p>Thanks</p>
|
java javascript
|
[1, 3]
|
3,709,247 | 3,709,248 |
Is it possible to call a Javascript function from HTML independent of an event?
|
<p>I have a condition in php based on some session variables. If condition passes, I want to call a Javascript function which is updating my current webpage. Is it possible to place such a call to Javascript function independent of a button or a link or the window load function?</p>
|
php javascript
|
[2, 3]
|
4,484,882 | 4,484,883 |
Clearing buttons .Text on Android issue
|
<p>I am making a tic tac toe app for android, and when I run my clear buttons function:</p>
<pre><code> b1.setText("");
b1.setEnabled(true);
b1.setBackgroundColor(Color.LTGRAY);
</code></pre>
<p>To just clear the text for the buttons and enable them for a new game, the space in between the buttons disappears and the 9 button grid looks like a solid square. When i click the place of the buttons an "X" still shows up so they are still there, but what am i missing that is making them blend together?</p>
<p>Winning combo code is:</p>
<pre><code> if ((b1.getText() == "X") && (b2.getText() == "X") && (b3.getText() == "X"))
{
disableButtons();
b1.setBackgroundColor(Color.RED);
b2.setBackgroundColor(Color.RED);
b3.setBackgroundColor(Color.RED);
Toast.makeText(getApplicationContext(), "Congrats! You Win!", Toast.LENGTH_LONG).show();
}
</code></pre>
<p>EDIT here are images of whats happening
<img src="http://i.imgur.com/fiQSptG.png" alt="first"></p>
<p><img src="http://i.imgur.com/Xxlcjn9.png" alt="second"></p>
|
java android
|
[1, 4]
|
2,056,447 | 2,056,448 |
Drag and drop problems using overflow auto
|
<p>Hello friends i m trying to make drag and drop functionality on my page but i have facing some problem . u can see my code <a href="http://jsfiddle.net/82jue/2/" rel="nofollow">here</a> .
i just want that when the user drag the box the top and left positions of the box match the mouse top and left positions please help</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,031,429 | 4,031,430 |
Accurate way of finding out number of times a file has been download
|
<p>I have a download page with a <code>linkbutton</code> that users use to download files. The event handler of the <code>linkbutton</code> sets up the Response type for the user to see the download dialog and chose to save it. I need to find out accurately how many times the file has been downloaded. If I increment a counter in the link button's event handler, I'd assume it wouldn't be accurate as the user may chose to click on Cancel in the download dialog.</p>
<p>Where exactly do I need to hook this counter incrementing logic?</p>
|
c# asp.net
|
[0, 9]
|
4,403,309 | 4,403,310 |
User control "ascx" file with C#
|
<p>I have a user control, basically consists of a tree view and also a drop down list..
The user control shows something like</p>
<p>(For the tree view)</p>
<pre><code> Books
Learn Algebra in 24hrs (30)
Learn Calculus in 1 week (16)
</code></pre>
<p>(For the Drop Down)</p>
<pre><code>--- Books ----
Learn Algebra in 24hrs (30)
Learn Calculus in 1 week (16)
</code></pre>
<p>the designer wants to be able to set a property to "true" or "false" in the ascx file that will hide the count on the right (if true shows, if false hides). The count comes from a database along with the product name.</p>
<p>How can I achieve this?, the do not want to deal with C#, but want to be able to deal with the "ascx" file.</p>
<p>Thank you in advance</p>
|
c# asp.net
|
[0, 9]
|
1,712,062 | 1,712,063 |
how to form a 3 digit code after a user enters some value in a textbox asp.net C#
|
<p>I want to first form a 3-digit code once a user enters some input in a textbox.</p>
<p>I have a database table that has the text value that is to be entered in a text box for these text values there is corresponding numeric value which ranges from 3-999.</p>
<p>suppose user enters 'asd' and corresponding value in the database table is 9 (<strong>both 'asd' and '9'should be compared in the database table</strong>) than i want a 3-digit number to be formed as '009'.</p>
<p>Similarly there are other controls such as DropDownList and other textboxes from which the user input must be read and converted to a particular numeric code and thus finally forming a 14 digit code.</p>
<p>How can i achieve this. I want to know the way i should proceed with this. I am very new to programming. </p>
|
c# asp.net
|
[0, 9]
|
463,567 | 463,568 |
how to kill/stop a jquery/javascript function?
|
<p>I have a jquery function :</p>
<pre><code>function getArrowScroll(dirX, dirY, ele)
{
return function()
{
arrowScroll(dirX, dirY, this, ele);
this.blur();
return false;
};
}
</code></pre>
<p>When the user hover the arrowDown button, it will auto scrolling the contents inside a div :</p>
<pre><code>if (settings.arrowScrollOnHover) {
arrowUp.bind('mouseover.jsp', getArrowScroll(0, -1, arrowUp));
arrowDown.bind('mouseover.jsp', getArrowScroll(0, 1, arrowDown));
}
</code></pre>
<p>When the scroll bar reach the bottom of div, jquery get more data from other page and add them to the div. At this point, <code>mouseover.jsp</code> is lost control already because I reinitialize everything except getArrowScroll(). It will keep scrolling down continuously non-stop by executing <code>getArrowScroll(0, 1, arrowDown)</code>. I need kill function getArrowScroll(0, 1, arrowDown) before reinitialize, or when
<code>mouseleave.jsp</code>. If I put :</p>
<pre><code>arrowDown.bind('mouseover.jsp',
getArrowScroll(0, 1, arrowDown)).bind('mouseleave.jsp',
getArrowScroll(0, 0, arrowDown));
</code></pre>
<p>it will still scrolling to bottom
because getArrowScroll(0, 1, arrowDown) is still running, how to kill or stop
function getArrowScroll()? </p>
|
javascript jquery
|
[3, 5]
|
470,430 | 470,431 |
C# - Efficient search and replace char array in string
|
<p>I have e.g. </p>
<pre><code>string str ='Àpple';
string strNew="";
char[] A = {'À','Á','Â','Ä'};
char[] a = {'à','á','â','ä'};
</code></pre>
<p>I want to look through the str and see if found replace with Ascii code 'A' . So the result should be:</p>
<pre><code>strNew = 'Apple';
</code></pre>
<p>Here is my code:</p>
<pre><code>for (int i = 0; i < str.Length; i++)
{
if(str[i].CompareTo(A))
strNew += 'A'
else if(str[i].CompareTo(a))
strNew +='a'
else
strNew += str[i];
}
</code></pre>
<p>But the compare function doesn't work, so what other function I can use?</p>
|
c# asp.net
|
[0, 9]
|
4,038,578 | 4,038,579 |
Styling a list item with a child
|
<p>I've been going around in circles for hours, I keep getting errors with this code :</p>
<pre><code>$('div.colA div.region-sidebar-left div.menu-block-wrapper').find('li').each(function() {
if ($(this).find('> ul').size() > 0) {
$(this).addClass('has_child');
}
});
</code></pre>
<p>All it is supposed to do is find all the <code><li></code> with a child of <code><ul></code> and give it a class. Simple.</p>
<p><a href="http://jsfiddle.net/simcox90/mEMmN/" rel="nofollow">http://jsfiddle.net/simcox90/mEMmN/</a></p>
|
javascript jquery
|
[3, 5]
|
3,811,541 | 3,811,542 |
Possible to make IE7 reload the DOM? Trying to update RSS href url in link tags
|
<p>I can use this jQuery code to dynamically change the RSS link in the DOM in Firefox & Chrome. <a href="http://path.com/feed" rel="nofollow">http://path.com/feed</a> is normally replaced by a variable, but not for this example.</p>
<pre><code>$('#rssfeed').remove();
$('head').append('<link id="rssfeed" rel="alternate" type="application/rss+xml" href="http://path.com/feed"/>');
</code></pre>
<p>The live bookmark feature immediately updates. However, this doesn't work in IE7.
In IE7 I have tried this method, also created an in the html and tried updating with .setAttribute(href,'path.com/feed'), and tried creating a new DOM element and attaching it to "<_head>" (no _ in the actual code, of course). </p>
<p>The only "success" I have had was doing a document.write. The big problem with this is that I can't change it after the page has loaded. </p>
<p>Can anyone recommend an alternate way to change the link element href and have it dynamically reloaded by IE7? Alternatively, is there a way to force the browser to re-interpret or reload the DOM without doing a full page refresh?</p>
|
javascript jquery
|
[3, 5]
|
1,357,278 | 1,357,279 |
Variable keeps old value
|
<p>Whenever i click the '#print' button for the second time, the value from the first click prints out before the real value.</p>
<p>For example:
I click button for the first time. The alert box prints out the correct value ('test1'). </p>
<p>I click button for the second time. The alert box prints out first value ('test1'), then i press OK, and right after that, the alert box prints out the second value ('test2').</p>
<p>Any ideas what i am doing wrong?</p>
<pre><code>$(".ipdate").focus(function() {
/*$('.dateBox').hide();*/
var tit = $(this).attr('id');
/*var full = '#'+tit+'B';*/
$('#dateBox').show();
$('#print').on('click', function(){
var bottle = $('.sday').val()+' '+$('.smon').val()+' '+$('.syear').val();
$('#'+tit).val(bottle);
alert(tit);
});
$('#close').on('click',function() {
$('#dateBox').hide();
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,582,396 | 2,582,397 |
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]
|
4,254,745 | 4,254,746 |
how to set event if cursor is out of an input tag in jquery
|
<p>im new to jquery and i want to know how to get value of an input tag when a cursor is out/left to that input element/tag. Thank you in advance.</p>
|
javascript jquery
|
[3, 5]
|
1,580,288 | 1,580,289 |
Taking value of edittext and putting a decimal point in it
|
<p>All-
I am working on an app in which the user enters the bill cost the tip rate. I know how to take the values of the edittext fields and preform the necessary math on them, but on the tip rate field I have to add a decimal point in front of the entered numbers. So if the user inputs "2" it shows up in the java code as ".2". Is there a way to do this?
Thanks in advanced! </p>
|
java android
|
[1, 4]
|
4,598,780 | 4,598,781 |
jQuery: stop a <select> list from moving on keypress?
|
<p>I have HTML/jQuery like this:</p>
<pre><code><select id="userlist" name="userlist">
<option value=''></option>
<option value="ADJUDICATION">ADJUDICATION</option>
<option value="ADMINISTRATIVE">ADMINISTRATIVE LAW</option> # etc
</select>
$("#userlist").keypress(function(e) {
windows_id += String.fromCharCode(e.which).toUpperCase();
// Only do anything if we have more than 1 initial.
if (windows_id.length > 1) {
// do stuff here
}
});
</code></pre>
<p>As you can see, if the user types more than two characters in, I want to do something special. </p>
<p>My question is this: is there any way I can prevent the <code><select></code> list from moving after the user has typed just one character, and instead, hold it still until the user has typed two?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
5,134,977 | 5,134,978 |
javascript variable scope in callbacks
|
<p>I'm curious how could this be written better:</p>
<pre><code>function Klass(variable) {
this.variable = variable;
this.callAjax = function() {
$.get('/url', { }, function(json) {
console.log(variable); //! <-- shows undefined
}, "json");
}
}
</code></pre>
<p>so I create a local variable: _variable</p>
<pre><code>function Klass(variable) {
this.variable = variable;
this.callAjax = function() {
var _variable = this.variable;
$.get('/url', { }, function(json) {
console.log(_variable); //! <-- its ok
}, "json");
}
}
</code></pre>
<p>and its fine, but I really don't this solutions,</p>
<p>Does someone of you have a better code?</p>
|
javascript jquery
|
[3, 5]
|
3,528,725 | 3,528,726 |
Java: Carriage returns populating a var in js code?
|
<p>I am not sure if this is possible, but I'm trying to find a front-end solution to this situation:</p>
<p>I am setting a JavaScript variable to a dynamic tag, populated by backend Java code:</p>
<pre><code>var myString = '@myDynamicContent@';
</code></pre>
<p>However, there are some situations, in which the content from the output contains a carriage return; which breaks the code:</p>
<pre><code>var mystring = '<div>
Carriage Return happened above and below.
</div>';
</code></pre>
<p>Is there anyway I can resolve this problem on the front-end? Or is it too late in the script to do something about it, because the dynamic tag will run before any JavaScript runs (thus the script is broken by that point)?</p>
|
java javascript
|
[1, 3]
|
2,492,880 | 2,492,881 |
JQuery select value into variable
|
<p>I have looked all over and cannot figure out why this code isn't working.</p>
<p><a href="http://jsfiddle.net/kCLxJ/" rel="nofollow">http://jsfiddle.net/kCLxJ/</a></p>
<p>When the drop down is set to value "3" or "4", then another field should pop up below the drop down list.
Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.