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 |
---|---|---|---|---|---|
2,684,331 | 2,684,332 |
Explain relative paths - VWD vs IIS
|
<p>Can someone breifly explain how c# treats paths - or perhaps the development environment and VWD (that is not acting as I think a server should)?</p>
<p>I have a page: <code>/content/consumer/MyPage.aspx</code>. My images are all in <code>/images</code>. </p>
<p>When I put <code>src="/images/myimage.jpg"</code> or <code>src="\images\myimage.jpg"</code> why am I not seeing my images? If I put <code>../../images/myimage.jpg</code> or <code>..\..\images\myimage.jpg</code>, I can see it or if I make it a server control and use <code>src="~/images/myimage.jpg</code> or <code>src="~\images\myimage.jpg</code> (at which point it changes it to the previous). What happened to my being able to just refer to the root by starting my path with a slash? Am I being forced to make all these controls run at the server (which seems like a waste of resources) or be stuck with declarative paths and messy nests of ..(/|)s?</p>
|
c# asp.net
|
[0, 9]
|
917,851 | 917,852 |
How to get Dom object's content include itself?
|
<p>I want to able to get #post content include itself. jQuery's html() method only return content that does not include itself.Trying to get parent object's html does not work in all situation because that object can have siblings. </p>
<p>What is solution for this ? </p>
<pre><code><div id="post">
<div>content</div>
<div>
<div></div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,783,223 | 5,783,224 |
Getting the row values of the listview by just simply clicking
|
<p>Is there anybody can give me the exact code on how to get the row values
of the listview when it is clicked. I don't want to put my listview control
with buttons like update, or delete buttons. All I want is just a plain listview
control with displayed data and when you click any rows, it will display on my
textboxes.I have already done this in my winform app and I want to use it also in
my asp.net app. I'm not sure what eventhandler I can use in asp.net to get the values
of the listview control by clicking the row whether if its <code>ListView1_SelectedIndexChanged</code> or <code>ListView1_ItemCommand</code>
because in winform app you can even use directly the <code>ListView1_Click()</code> eventhandler by just setting its properties to fullrowselect
and mousehover. I want my listview in asp.net acts exactly that way in which before you click the row it will hover the mouse
with highlighted full row select.I just followed the format of my codes in my winform app using the code below but not sure
if that is right because it doesn't do anything.Here's my code below. Please advise. Thanks.</p>
<pre><code>protected void ListView1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox1.Text = ListView1.Items[0].ToString();
TextBox2.Text = ListView1.Items[1].ToString();
TextBox3.Text = ListView1.Items[2].ToString();
TextBox4.Text = ListView1.Items[3].ToString();
TextBox5.Text = ListView1.Items[4].ToString();
TextBox6.Text = ListView1.Items[5].ToString();
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,759,402 | 4,759,403 |
.text() immediately being processed
|
<p>I do not know what title to give so please I do apologize, i'm just getting curious why in the code below, the text is getting changed before it even fades out even if i've put it after a fade.</p>
<pre><code>$('form').submit(function(){
return false;
});
$('button').on('click',function(){
$(this).addClass('busy');
$(this).parent().find('button').attr('disabled',true);
$(this).parent().find("button:not('.busy')").fadeOut(500);
$('p').text('Processing..').fadeIn(500).trigger('sfsfsf','wala');
});
$('p').on('sfsfsf',function(e,data){
//this line below
$(this).delay(1000).fadeOut(500).text('Complete!');
$(this).fadeIn(500,function(){
$(this).delay(500).fadeOut(500);
});
});
</code></pre>
<p><a href="http://jsfiddle.net/v4nwQ/" rel="nofollow">http://jsfiddle.net/v4nwQ/</a></p>
<p>Why is that so, and how do i Fix it?</p>
|
javascript jquery
|
[3, 5]
|
964,223 | 964,224 |
$.when not waiting for ajax return
|
<p>I have this code</p>
<pre><code>$('#mySelect').change(function() {
$.get(
"test.php",
function(data) { alert('test1'); }
);
});
</code></pre>
<p>I need to fire the event change of #mySelect, and wait for the answer of the ajax to perform a other task. But when I try</p>
<pre><code>$.when($('#mySelect').change()).done(function() { alert('test2'); });
</code></pre>
<p>It only wait for the change is finish, and the ajax sended, not received.
So I have the alert 'test2' before 'test1'
How can I make $.when wait for everything inside the even to be finish?</p>
|
javascript jquery
|
[3, 5]
|
2,899,781 | 2,899,782 |
retrieving $_GET variable in jquery
|
<p>I have a main page (topic.php) with GET information in the URL, like this:<br></p>
<pre><code>http://studio.byuipt.net/topic.php?topic=Debugger&desc=Helps%20find%20and%20solve%20problems%20with%20others%27%20code.
</code></pre>
<p>I have a div, "currLeader" in topic.php into which I load another page, getCurrLeader.php. getCurrLeader.php is supposed to use the topic variable in the $_GET info of the url to do a mysql search and return the relevant info. The problem is that while, scripts on topic.php are able to successfully use <code>extract($_GET)</code>, I am not able to retrieve any variables out of the getCurrLeader.php <code>extract($_GET)</code> statement. I thought both pages would be able to access the currently showing url. Is there another way I can get this information out of the current url?</p>
<p>(consequently, the "topic" info is actually present in an element with an id on the page, and I'm able to successfully retrieve it using jquery, but I can't figure out a way to then, within the same file, pass that value to my php script).</p>
|
php jquery
|
[2, 5]
|
1,406,038 | 1,406,039 |
Call a function in code behind in aspx?
|
<p>I have this:</p>
<pre><code><ItemTemplate>
<asp:CheckBox ID="cbRemove" runat="server"
Visible='<%# (string)Eval("GroupDescription") != "Default" %>' />
</ItemTemplate>
</code></pre>
<p>Only problem is, it might not be 'Default'. Is there a way I could call a function like GetDefaultName in my code behind that would get it from the database?</p>
|
c# asp.net
|
[0, 9]
|
2,208,367 | 2,208,368 |
Make default homepage for IE9 javascript
|
<p>I am trying to make a default homepage script using the famous script for IE but I'm trying to add it in a jquery function.</p>
<p>So this works:</p>
<pre><code><a href="#" onClick="document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.google.com');">
Click here to make My Site your default homepage
</a>
</code></pre>
<p>but this doesn't:</p>
<pre><code><a href="#" onClick="">
Click here to make My Site your default homepage
</a>
$('a').click(function() {
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.google.com');
});
</code></pre>
<p>What I'm I doing wrong?</p>
<p>EDIT: <strong>Please note the on click function doesnt work for IE9.</strong> IE6,7 and 8 it works.</p>
|
javascript jquery
|
[3, 5]
|
3,184,094 | 3,184,095 |
loading secondary resources like images and such
|
<p>I want to show image and its text initially as we open the page for my Image Slider.</p>
<p>This is my demo: <a href="http://codebins.com/bin/4ldqp9c/15" rel="nofollow">http://codebins.com/bin/4ldqp9c/15</a></p>
<p>here i am showing as all the DOM elements is loaded, but the need is to show the first image and its text initially for my slider as we open the page.</p>
<p>So I am not understanding how to load my initial image for my slider, so that its functionality starts after all DOM elements load.</p>
|
javascript jquery
|
[3, 5]
|
1,277,594 | 1,277,595 |
Jquery .val() == ** adding multiple possible answers **
|
<p>I achived this by doing the following, but as a newbie to javascript and jquery i want to know if there is any shorter way to add multiple possible values.</p>
<pre><code>if ($("input:first").val().toUpperCase() == "UNITED STATES" || $("input:first").val().toUpperCase() == "USA" || $("input:first").val().toUpperCase() == "AMERICA") {
$("#check").text("Correct!").show().fadeOut(5000);
return true;
</code></pre>
<p>Like </p>
<pre><code>if ($("input:first").val().toUpperCase() == ("UNITED STATES","USA","AMERICA")) {
$("#check").text("Correct!").show().fadeOut(5000);
return true;
</code></pre>
<p>by this only validates the last answers in this case AMERICA.</p>
|
javascript jquery
|
[3, 5]
|
3,662,934 | 3,662,935 |
enable postback onclick of a hyperlink in asp.net
|
<p>I have a hyperlink as</p>
<pre><code><a href="" id="link1">Click</a>
</code></pre>
<p>I have do enable a post back action whenever this link is clicked.</p>
<p>We can do </p>
<p><code><a href="" id="link1" onclick="javascript:location.reload()">Click</a></code></p>
<p>However, I want to do a page postback and not a page reload.</p>
<p>Is it possible?</p>
|
javascript asp.net
|
[3, 9]
|
969,620 | 969,621 |
What are FTL files
|
<p>I am new to a project and have to learn it inside out. I see allot of files with the extension .ftl in them. Not sure what they are. I know they can be modified an the user sees changes in the front end </p>
|
java javascript
|
[1, 3]
|
2,677,155 | 2,677,156 |
What is your preferred order of elements in the body of program code? Why?
|
<p>Of course at the top of a .java or .cs file are the package/namespace declaration followed by import/using statement.</p>
<p>But what riles me is where should I put the variable declaration? At the top or at the bottom?</p>
<p>This is how I prefer;</p>
<pre><code>package/namespace declaration
import/using declaration of microsoft's/java namespaces
import/using declaration of standard 3rd party namespaces
import/using declaration of my personal namespaces
constructors
private methods, each preceded by any private variable that was first used.
protected methods, each preceded by any private variable that was first used.
public methods, each preceded by any private variable that was first used.
inner/nested classes and enums
private anon classes assignment
protected variables/anon classes assignment
public variables/assigned anon classes assignment
</code></pre>
<p>But I realise many people like to put all the variables right at the top after the package/namespace and import/using declarations. That is troublesome because sometimes the number of variables and assigned anon classed gets too many, and that obscures the visibility of the constructors - the first lines I need to be visible are the constructors because they tell me the signature of instantiation.</p>
<p>And then for anon classes that are immediately assigned to a variable - I consider them part of the "structure of variables", so I group them variables.</p>
<p>I systematize the placement of my code elements to enable me to easily locate them.</p>
|
c# java
|
[0, 1]
|
1,690,552 | 1,690,553 |
Take image of div in ASP.net
|
<p>I am trying to make T-shirt design website. User customize its t-shirt by putting diffrent div and image over t-shirt div which has t-shirt in background using jquery now after final customization I want to save the picture of t-shirt/div so I can save customization.</p>
<p>How can i save customization div into image?</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
982,613 | 982,614 |
Issue created a button in layout (Android)?
|
<p>I am trying to use two buttons in one layout:</p>
<ul>
<li>a button to notes, which is working below</li>
<li>a button to calculator (button10)</li>
</ul>
<p>I get this error on super.oncreate:</p>
<pre><code>"The method onCreate(Bundle) is undefined for the type Object"
</code></pre>
<p><strong>main.java:</strong></p>
<pre><code>public class IzzynActivity extends Activity{
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button wg = (Button) findViewById(R.id.button1);
wg.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(IzzynActivity.this, notes.class);
IzzynActivity.this.startActivity(myIntent);
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button wg = (Button) findViewById(R.id.button10);
wg.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent(IzzynActivity.this, calculator.class);
setResult(RESULT_OK, intent);
finish();
}
});
}
}
}
}
</code></pre>
|
java android
|
[1, 4]
|
6,019,081 | 6,019,082 |
Symbol cannot be resolved
|
<p>Android Java project, minimal code to reproduce the problem:</p>
<p><code>Constants.java</code>:</p>
<pre><code>package alex.restaurantfinder;
public class Constants {
public static final String LOGTAG = "...";
}
</code></pre>
<p><code>ReviewCriteria.java</code>:</p>
<pre><code>package alex.restaurantfinder;
import android.app.Activity;
public class ReviewCriteria extends Activity {
static String s = Constants.LOGTAG; // error
}
</code></pre>
<p>Error message: </p>
<blockquote>
<p>Constants.LOGTAG cannot be resolved. </p>
</blockquote>
<p>Where is my error?</p>
<p><strong>Edit</strong>.
The problem was, when I pressed Ctrl+Shft+O in Eclipse, it added this line:</p>
<pre>
import android.provider.SyncStateContract.Constants;
</pre>
<p>It prevented compiler to work with my own Constants class.</p>
|
java android
|
[1, 4]
|
2,943,687 | 2,943,688 |
Disabling checkboxes that are not checked with jQuery?
|
<p>How do I disable ALL checkboxes on a page that are not checked? Do I need to first scan through all the checkboxes or is there a simpler way? I'm still a jQuery newbie</p>
|
jquery asp.net
|
[5, 9]
|
4,062,454 | 4,062,455 |
Sorting a datatable with datatable.DefaultView.Sort
|
<p>I'm trying to sort a datatable. But it's not working.</p>
<pre><code>arr[0] = "name";
arr[1] = "DESC";
myDataSet.Tables["table1"].DefaultView.Sort = arr[0] + " " + arr[1];
</code></pre>
<p>Here, <code>myDataSet</code> refers to dataset I'm using for the reportviewer.</p>
<p>Am I missing something? Is there any other way?</p>
|
c# asp.net
|
[0, 9]
|
1,970,819 | 1,970,820 |
PHP/jQuery - Highlight the menu with current page
|
<p>Hi<br />
I am going to highlight a menu item according to the page that is reading currently, when user click on different page through the menu, that menu item will be highlighted, example is <a href="http://templates.joomlart.com/ja_pyrite/index.php?option=com_content&view=article&id=44&Itemid=53" rel="nofollow">http://templates.joomlart.com/ja_pyrite/index.php?option=com_content&view=article&id=44&Itemid=53</a>.</p>
<p>If I use PHP/jQuery to check the url and highlight the menu, it will be good if the url look like "http://example.com/contact", but the example above is bad.</p>
<p>If I don't going to check the url and highlight the menu item, could someone give me a idea/method that can be done with the same effect?</p>
<p>Thank you</p>
|
php jquery
|
[2, 5]
|
5,057,820 | 5,057,821 |
How check and filter emails in android?
|
<p>I'm trying to develop an android application that sends and receives filtered emails from a particular email account. I made the send of the mail, but my question is that if there is a way to receive, I mean to check a email and filter the new email only from a particular account, everything in the android app.</p>
|
java android
|
[1, 4]
|
2,749,324 | 2,749,325 |
Why jQuery function returns null?
|
<p>I have this form:</p>
<pre><code><form action="javascript:;" class="iceFrm" enctype="application/x-www-form-urlencoded" id="frmMainMenu" method="post" onsubmit="return false;">
.....
</form>
</code></pre>
<p>I do not understand why this script:</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$("#frmMainMenu").$("#menuPopupAP").$("#menuItem0").$("#out").css('padding','0 0 0 29px');
});
</script>
</code></pre>
<p>says:</p>
<blockquote>
<p><code>$("#frmMainMenu")</code> is null</p>
</blockquote>
<p>in Firebug.</p>
<p><strong>UPDATE:</strong>
This is the html element (from the above form) I want to change the padding on:</p>
<pre><code><span id="frmMainMenu:menuPopupAP:menuItem0:out" class="iceOutTxt iceMnuItmLabel graMenuPopupMenuItemLabel">My Applications</span>
</code></pre>
<p>Update 2:</p>
<p>I've forgot to mention that this span is within a menu, so basically it's hidden normally and displayed only when hovering on some div... Does jQuery finds it even if it's not displayed?</p>
<p>Do you know why?</p>
|
javascript jquery
|
[3, 5]
|
5,256,149 | 5,256,150 |
Redirection code not working
|
<p>I have a problem with my role redirection. Why my code</p>
<pre><code> {
if (Roles.IsUserInRole(Login1.UserName, "Adminstrator"))
Response.Redirect("~/4_Admin/Page1.aspx");
else if (Roles.IsUserInRole(Login1.UserName, "Users"))
Response.Redirect("~/3_User/Expense.aspx");
}
</code></pre>
<p>is not working? It give me a headache after I spent like what, 3 days? Thank you for your time.</p>
|
c# asp.net
|
[0, 9]
|
687,788 | 687,789 |
checkbox chekced or unchecked does not trigger event
|
<p>There is an exisiting page I am working on at where I work, and there is a checkbox in the ascx , and it has a CheckedChange event for it in its .cs The problem I am having with that page is that when i run the website and check the box, it never fires the event, instead it goes through the On_Load event and it never pass throgh the event... I am not sure why it is not firing the event...</p>
<pre><code> <asp:CheckBox runat="server" ID="OptionSelected"
OnCheckedChanged="OptionSelected_CheckedChanged"
AutoPostBack="true" />&nbsp;
<asp:Label runat="server" ID="OptionHeader"></asp:Label>
protected void OptionSelected_CheckedChanged(object sender, EventArgs e)
{
//some code here
}
</code></pre>
<p>PS: This is a control ascx sorry, I forgot to mention. Also another symptom is that the page where that control is... it refreshes unexpectedly, clears some data (including the checkbox if it is checked) and cant figure out what it is causing it.</p>
<p>Any ideas of the reason why this might be happening? things i should look for?</p>
<pre><code>public PortalInfoPortal myPortal
{
get
{
return portal.GetPortalInfo();
}
}
protected void Page_Load(object sender, EventArgs e)
{
//added this an nothing
OptionSelected.CheckedChanged += new EventHandler(OptionSelected_CheckedChanged);
if (myPortal != null)
{
lblOptionMsg.Text = "(" + myPortal.MaxOptionSelectedCharacters.ToString() + " char max)";
txtMessage.MaxLength = myPortal.MaxOptionSelectedCharacters;
var maxLength = myPortal.MaxOptionSelectedCharacters;
maxCheck.ValidationExpression = @"^[\s\S]{0," + maxLength.ToString() + "}$";
}
//There is no binding of any type here
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,998,508 | 3,998,509 |
Lost in jQuery .each()
|
<p>In the script below, I'm trying to parse through a select list and for each option, call a php that returns a value (psuedo true/false) based on the options "value" attribute.</p>
<p>However, when I'm inside the $.get [to evaluate the return value and execute script against the current option in the each(),] I can't figure out how to reference the current option element in order to modify it. </p>
<pre><code>$('#my_Select').click(
function(){
$('#my_Select option').each(
function(){
$.get(
'<?php echo getStyle.php',{option: $(this).val()},
function(response){
alert($(this).val()); //Returns empty alert. Should return value of current option
//$(this).attr("disabled","disabled");
//if (response.Success){$(this).attr("disabled","disabled");}
});
});
});
</code></pre>
<p>Here's the php script for reference...</p>
<pre><code><?php
//getStyle.php
$myOption = $_REQUEST['option'];
$file = "styles/".$myOption."/style.css";
//echo json_encode(file_exists($file));
if (!file_exists($file))
{
$Response = array('Success' => true);
}
else
{
$Response = array('Success' => false);
}
echo json_encode($Response);
?>
</code></pre>
|
php jquery
|
[2, 5]
|
4,110,126 | 4,110,127 |
Android Image Viewer from App
|
<p>I'm trying to launch an image which is written to my application directory with the builtin Android image viewer. This image has been written in a different part of the app to the app directory. When getting the following file:</p>
<p><code>super.getFilesDir() + "/current.png"</code></p>
<p>File.exists() returns true.</p>
<p>How can i launch the builtin Android image viewer to view this file?
Currently i'm doing:</p>
<pre><code>File f = new File(super.getFilesDir()+"/current.png");
uri = Uri.parse("file://"+super.getFilesDir()+"/current.png");
startActivity(new Intent(Intent.ACTION_VIEW, uri));
</code></pre>
<p>And it keeps churning out:</p>
<blockquote>
<p>10-11 13:09:24.367:
INFO/ActivityManager(564): Starting
activity: Intent {
act=android.intent.action.VIEW
dat=file:///data/data/com.davidgoemans.myapp/files/current.png
} 10-11 13:09:24.367:
ERROR/myapp(2166): Exception
occuredandroid.content.ActivityNotFoundException:
No Activity found to handle Intent {
act=android.intent.action.VIEW
dat=file:///data/data/com.davidgoemans.myapp/files/current.png
}</p>
</blockquote>
<p>irrespective of what i change the uri schema to ( eg, content://, file://, media://, image:// ).</p>
|
java android
|
[1, 4]
|
2,395,259 | 2,395,260 |
Convert UNIX Timestamp to any format desired?
|
<p>For example:
I was able to get the timestamp</p>
<pre><code>String date="123456765343";
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(Long.parseLong(date)*1000);
Date d = cal.getTime(); // now this reprents the unix timestamp
</code></pre>
<p>I would like to have the date looking like this : </p>
<p><strong>14/Mar/2013 6:31:34 PM</strong></p>
|
java android
|
[1, 4]
|
2,213,028 | 2,213,029 |
transition background-image/css change on hover?
|
<p>I have a thumb nail inside another div, when the thumbnail is hovered I want the parent div to fade/transition to the background of the thumbnail, then fade back to the original image after hover.</p>
<p>I have this so far which changes the parent background to that of the thumbnail and back but with no transition.</p>
<pre><code>$(document).ready(function() {
var originalBG;
var hoverBG;
$(".alt-img").hover(
function () {
originalBG = $(this).parent().css('backgroundImage');
hoverBG = $(this).css('backgroundImage');
$(this).parent().css('backgroundImage',hoverBG);
},
function () {
$(this).parent().css('backgroundImage',originalBG);
}
);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,666,451 | 1,666,452 |
perform a function when form values change
|
<p>Im trying to call a function when the value of any form value changes.</p>
<p>This is my code:</p>
<pre><code>function reload()
{
tmp = findSWF("chart");
x = tmp.reload("chart.php", false);
}
function findSWF(movieName) {
if (navigator.appName.indexOf("Microsoft")!= -1) {
return window["ie_" + movieName];
} else {
return document[movieName];
}
}
$(".formclass").change(function() {
reload();
});
</code></pre>
<p>If i make a link with an <code>onclick</code> action, it works, but using the last <code>.change</code> action, nothing happens.
Ideally, i could also pass the name and value of what has changed to that url</p>
|
javascript jquery
|
[3, 5]
|
74,460 | 74,461 |
ASP .Net Gridview
|
<p>I'm using a form to populate a gridview with x users. However I want whenever I call the function if there is only 1 user displayed inside the gridview to autoselect that first user.</p>
<p>So within my callback function I have </p>
<pre><code>if (users.count == 1)
{
// Do something
}
</code></pre>
<p>I currently use the following function upon someone pushing "select" alongside the gridview.</p>
<pre><code>Users_SelectedIndexChanged(object sender, EventArgs e)
</code></pre>
<p>It would be nice if I could reuse this function and do something like</p>
<pre><code>if (users.count == 1)
{
Users_SelectedIndexChanged(object sender, EventArgs e);
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,483,801 | 2,483,802 |
Saving large amounts of data when onPause is called?
|
<p>For my app, I have about 15Mb (which can be compressed with some processing power to about 5Mb) of audio+video+image data that I need to save to disk. For instance, I need to save this when user is interrupted with a phone call (because the activity might get killed after this) and when the user leaves the app.</p>
<p>I can save the data to SD card in about 10 seconds if I don't compress it and something like 20 seconds if I do compress it, where I'd like it compressed. <b>What options to I have for saving my data when onPause is called such that I can be sure the data has been saved?</b></p>
<p>From some basic experiments, my activity gets killed if onPause hasn't finished after 5 seconds. Some ideas I've had:</p>
<ol>
<li><p>Starting a new Thread in onPause and saving the data there. This seems to work fine but seems like something I shouldn't be doing.</p></li>
<li><p>Starting a service, copying the data to the service somehow (would this be slow?) and then getting the service to save the data. I think this puts a notification icon at the top of the phone, but I don't think it's awful for a user to see the "Saving data..." task here.</p></li>
<li><p>Can I put the data in a SQL database quickly and then save it later when the user returns to the app?</p></li>
</ol>
<p>(Due to the nature of the app, there really isn't any practical way I can save the data as I go because the user can transform the data in destructive ways with time consuming operations (e.g. 10 seconds for some operations). Even if I stored the original data and a list of the actions performed to recreate the data, the user would have to wait a minute or two when the app is next started up to process this.)</p>
|
java android
|
[1, 4]
|
4,701,208 | 4,701,209 |
Get Element ID and passing into function
|
<p>I'm using javascript to get my element id value. But out of 3, one of my element id does not parse in. It gives me [object HTMLInputElement] while the rest of element id values can work.</p>
<p>Sample Code:</p>
<pre><code><?php
$Name = "Johnnnny";
echo "<input type=\"hidden\" name=\"Name\" id=\"Name\" value=\"$Name\"/>";
?>
<script>
var ID= document.getElementById('ID').value; //this works.
var Name = document.getElementById('Name').value; //give me [object HTMLInputElement]
</script>
</code></pre>
<p>Kindly advise. It should be able to get the ElementID of 'Name'.value </p>
|
php javascript
|
[2, 3]
|
2,447,900 | 2,447,901 |
Replace an entire tag with a string in a string
|
<p>I want to dynamically generate an input field based on the content of a paragraph containing some img tags (i.e. emoticons) and want to replace those images (the entire img tag) with an equivalend string (e.g. <strong>:)</strong>)</p>
<p>I tried the following function and it just does not work as expected. (Even when I alert the data and use it for replacement)
Moreover, as I have many images I thought there would be a better way to find and replace the entire tag in a string with jQuery. Any idea?</p>
<pre><code>TXT = convertSmiley(TXT);
var convertSmiley = function(data) {
data = data.replace('<img src="/images/smiley/happy.png" style="margin-bottom:-4px;" height="16" width="16">',':)'); // which does not seem to work
return data;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
247,757 | 247,758 |
Pass variable to JS file
|
<p>Although this question have been asked and answered before, including on this website, I am not managing to solve my problem.</p>
<p>I am using Masterpages, and Javascript files... and everyone now how "tricky" masterpages get with relative paths...</p>
<p>Well, I am using a png fix called: unit Png Fix (quite good to be honest... even better than the JQuery one), and this fix needs to use a small image called clear.gif.
The path to the clear.gif file is being stored inside a variable that is in the JavaScript file.</p>
<p>However, and since I am using Masterpages I cannot simply open the JS File and write a static path... has i thought.</p>
<p>What I tried was: remove the variable from the JS File, and declare it outside, but in the sabe Script block. Like this:</p>
<pre><code> <!--[if lt IE 7]>
<script src="<%= ResolveClientUrl("~/masterpages/js/unitpngfix.js") %>" type="text/javascript">
var clear="<%= ResolveClientUrl("~/masterpages/img/clear.gif") %>";
</script>
<![endif]-->
</code></pre>
<p>I even tried to declare it in the Head of the website. (I'm placing my JS files at the bottom of my page, to speed it up).</p>
<p>Unfortunately my solutions didn't work... which is why i am doing this question here. :(</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
1,861,431 | 1,861,432 |
How to disable all Element inside a div or table using jQuery
|
<p>I have a table that contains several text box and buttons.I disable my table using jquery by this code:</p>
<pre><code> $("#tbl").attr("disabled", "disabled");
</code></pre>
<p>my table become disabled but when I double click on the button it become enable and I can enter characters in my text box too. How I can Disable all control inside a table?</p>
<p>thanks</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,349,537 | 4,349,538 |
Two questions: should I do client-side or server-side in terms of validation? Also, how would I verify that no textbox is blank/invalid...
|
<p>...with jquery/javascript? I want to check and make sure that a value has been entered and that it's a number.</p>
<p>First - Is it a best practice to do validation on the client-side, server-side, or both? Is this something that should be validated twice or is checking on the client-side enough?</p>
<p>Second - If client-side validation is the best way to go about this, how could I do this with javascript/jquery? I assume that for the button that's clicked, I would assign its <code>onclientclick</code> equal to a javascript function.</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,495,765 | 3,495,766 |
How to Find Current Row of Repeator in parent repeater?
|
<pre><code><asp:Repeater ID="rp1" runat="server">
<ItemTemplate>
<ul>
<li>
<%#Module(Convert.ToInt32(Eval("id")),Eval("university").ToString()) %>
<asp:Repeater ID="rp2" runat="server">
<ItemTemplate>
<ol>
<li id="sublist" runat="server">
<%#Eval("college") %>
</li>
</ol>
</ItemTemplate>
</asp:Repeater>
</li>
</ul>
</ItemTemplate>
</asp:Repeater>
</code></pre>
<h1>C# CODE</h1>
<pre><code>public string Module(int id,string university)
{
con = new SqlConnection(ConStr);
con.Open();
cmd = new SqlCommand("SELECT college FROM tbluniversity where id=" + id, con);
da = new SqlDataAdapter(cmd);
con.Close();
ds = new DataSet();
da.Fill(ds);
//Here I want to find the inner repeator of current row then bind this dataset to that.
how to find Repeator
return university;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,715,516 | 1,715,517 |
How to grab the width attribute of an element using jQuery?
|
<p>I created a graph using html, now I want to give it a nice effect when it initially loads. I want the bars of the graph to fly in from the left. The code below does that, only problem is each bar ends up with 70% width (obviously since I set that in the jQuery code). Instead I need that number to be unique to the width set within the bars (span tags). I assume the answer would be something like:</p>
<pre><code>$(this).attr('width')...
</code></pre>
<p>but I can't get it to work, please help.</p>
<p>The Code:</p>
<pre><code><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<style type="text/css">
div.graph { display: none; border: 1px solid red; height: 200px; width: 400px; margin: 0 auto; }
div.graph span { display: none; display: block; background: red; height: 20px; margin-bottom: 10px; }
</style>
<script type="text/javascript">
$(document).ready(function() {
$('div.graph').fadeIn('slow');
$('div.graph > span').animate({
width: "70%"
}, 1500 );
});
</script>
<div class="graph">
<span style='width:10%'></span>
<span style='width:40%'></span>
<span style='width:25%'></span>
<span style='width:15%'></span>
<span style='width:10%'></span>
</div><!-- graph -->
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,025,280 | 1,025,281 |
Using jQuery to hide/show a Panel inside of a table
|
<p>I have an ASP.NET web form, with table. Inside the table, I have a radiobuttonlist control and below that I have a Panel. Inside the panel are several tags with other web controls. </p>
<p>What I want to do is have the panel display or hide based on the selection in the radiobuttonlist. In my jQuery I have this:</p>
<pre class="lang-js prettyprint-override"><code>$(document).ready(function() {
$('#<%= rblCarrier.ClientID%>').find('input:radio').click(function() {
var selVal = $('#<%= rblCarrier.ClientID %>').find('input:checked').val();
if (selVal == "1") $("#mydiv").show("fast");
else $("#mydiv").hide("fast");
})
});
</code></pre>
<p>If I replace <code>$("#mydiv").show("fast");</code> with an <code>alert</code> the <code>alert</code> displays, so I know everything up to that point is working.</p>
<p>Remember, my asp.net panel is inside of an HTML table.</p>
<p>All I want to do is show the contents of the panel if the radio button value is "1", otherwise hide it.</p>
|
jquery asp.net
|
[5, 9]
|
2,052,275 | 2,052,276 |
My focus by keyboard navigation does't set in internet explorer and it works fine in FF
|
<p>I have one ID <code>#carousel_inner</code> and i set the focus on that id by keyboard navigation but this focus doesn't work on IE and its work fine with FF.</p>
<pre><code> $("#carousel_inner").attr("tabindex",0).focus(function() {
$(document).keyup(function(e){
if ( document.activeElement.id === 'carousel_inner' ) {
if(e.which==37) {//left arrow
$(previous).click();//emulates click on prev button
} else if(e.which==39) {//right arrow
$(next).click();//emulates click on next button
}
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,607,981 | 4,607,982 |
Click through the image
|
<p>I have a image border (its on hexagon map so border must be image) that shows on hover on each hex. And now i want to use jQuery .click() function on some hexes but I can't click on the hex through the hover image. Is there any way to solve it?</p>
<p>Thank you very much.</p>
<p>PS: The hover image looks like this:
<a href="http://perludus.com/examples/hexmap/hex-highlight.png" rel="nofollow">http://perludus.com/examples/hexmap/hex-highlight.png</a>
(border and the rest is transparent)</p>
|
javascript jquery
|
[3, 5]
|
4,099,821 | 4,099,822 |
Validate form before button click
|
<p>I have a form on the contact page which i want to validate before the user clicks the submit button.</p>
<pre><code><form id="contact" name="f1" action="mail.php" onsubmit="validate()">
</code></pre>
<p>I have Javascript code which does validation of fields. But, when i click on the button the user is redirected to 'mail.php' without doing validation.</p>
|
php javascript
|
[2, 3]
|
1,427,841 | 1,427,842 |
table lost on postback
|
<p>I'm working on a web based quiz system.</p>
<p>I have code that generates an ASP.NET table with a list of questions and radiobutton lists that indicate the answers for the quiz questions.</p>
<pre><code>//Retrieve questions and answers - build the actual quiz
DataTable dtQuiz = qr.GetQuizQuestions(QuizID);
if (dtQuiz != null && dtQuiz.Rows.Count >= 1)
{
foreach (DataRow row in dtQuiz.Rows)
{
TableRow tr = new TableRow();
TableCell tcQuestionNum = new TableCell();
TableCell tcQuestion = new TableCell();
tcQuestionNum.VerticalAlign = VerticalAlign.Top;
tcQuestionNum.Controls.Add(new LiteralControl(row["QuestionNum"].ToString()));
tcQuestion.Controls.Add(new LiteralControl(row["Question"].ToString()));
RadioButtonList rblAnswers = qr.GetAnswers(QuizID, Int32.Parse(row["QuestionNum"].ToString()));
tcQuestion.Controls.Add(rblAnswers);
tr.Cells.Add(tcQuestionNum);
tr.Cells.Add(tcQuestion);
tblQuiz.Rows.Add(tr);
tblQuiz.DataBind();
}
}
</code></pre>
<p>This code generates the content just fine - the quiz questions appear, and the radiobutton lists render as expected.</p>
<p>There's something weird when I have a separate button click event. After the user selects their answers, I want to do a postback and loop through the rows in the table, pulling the answers from the radiobutton list in the second cell of each row. I started down this path:</p>
<pre><code> foreach (TableRow tr in tblQuiz.Rows)
{
TableCell tc = tr.Cells[1];
RadioButtonList rbl = (RadioButtonList) tc.Controls[1];
}
</code></pre>
<p>The problem is when the second button is clicked (to post the answers), the table has no rows. Why is this, and how can I correct this?</p>
|
c# asp.net
|
[0, 9]
|
4,393,594 | 4,393,595 |
load jQuery in another js file
|
<p>I have a JavaScript file, which also uses jQuery in it too. To load it, I wrote this code:</p>
<pre><code>function include(filename)
{
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.src = filename;
script.type = 'text/javascript';
head.appendChild(script)
}
include('http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js');
alert("1");
$(document).read(function(){});
alert("2");
</code></pre>
<p>This fires <code>alert("1")</code>, but the second <code>alert</code> doesn't work. When I inspect elements, I see an error which says that <code>$</code> in not defined.</p>
<p>How should I solve this problem?</p>
|
javascript jquery
|
[3, 5]
|
988,367 | 988,368 |
How do jquery library implement the $("") in jquery-1.x.x.js source code?
|
<p>Recently I begin to study the jquery, I feel confused how jquery library implement the <strong>$</strong>, I walked through the jquery source code and still cannot understand it.</p>
<p>Why is <strong>$( "#xid" )</strong> equivalent to <strong>getElementById("xid")</strong>?</p>
<p>Could you please explain <strong><em>$</em></strong> for me according to the <strong>source code of jquery</strong>?</p>
<p>thanks.</p>
|
javascript jquery
|
[3, 5]
|
622,635 | 622,636 |
Get total amount for each individual row
|
<p>I am working on at the moment whereby I need to multiply 2 input values (quantity & amount) and then get the total. My issue lies with getting the total for each individual 'row' ideally on keyup as there will be multiple rows / fieldsets. </p>
<p>HTML:</p>
<pre><code><fieldset>
<p>Title</p>
<label id="">Quantity</label><input type="text" class="quantity" id="" value="Quantity" name="">
<label id="">Amount</label><input type="text" class="amount" id="" value="Amount" name="">
<label id="">Total</label><input type="text" class="total" id="" value="Total" name="">
</fieldset>
<fieldset>
<p>Title</p>
<label id="">Quantity</label><input type="text" class="quantity" id="" value="Quantity" name="">
<label id="">Amount</label><input type="text" class="amount" id="" value="Amount" name="">
<label id="">Total</label><input type="text" class="total" id="" value="Total" name="">
</fieldset>
</code></pre>
<p>Multiple rows can be added via a button. Any help is greatly appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,649,520 | 5,649,521 |
How does one turn a Gridview Row clickable which open a modalpopup in C#?
|
<p>How does one turn a Gridview Row clickable which open a modalpopup in C#?</p>
<p>I have a gridview with several columns. Each row (the entire width of the row) needs to be clickable which onclick opens a modalpopupextender displaying a popup panal with detailed info on the row.</p>
<p>I have the modalpopupextender & panal working properly when an ImageButton is clicked. However I am removing the ImageButton and replacing its functionality with the row onClick.</p>
<p>I appreciate your time!</p>
|
c# asp.net
|
[0, 9]
|
3,079,417 | 3,079,418 |
how to set OnClientClick to be true?
|
<p>I wonder how to use jquery click a button and set it's OnClientClick to be true, so the validation process will not run. I use</p>
<pre><code>$("[id$='btn_Save']").attr('OnClientClick', true);
$("[id$='btn_Save']").Click();
</code></pre>
<p>But it does not work.</p>
|
jquery asp.net
|
[5, 9]
|
3,287,735 | 3,287,736 |
select by class AND id that has been stored in var
|
<p>I have this code :</p>
<pre><code>$('.more_results').click(function() {
var userid = $('#userid').text();
var more = $(this).attr('id');
$.post('myquests.php', {userid:userid, more:more}, function(html) {
$(more+".more_results").remove();
$("#tab1").append(html);
});
});
</code></pre>
<p>my issue is trying to select by the class and the stored id. So it would be like <code>.more_results#1, .more_results#2</code>, etc</p>
|
javascript jquery
|
[3, 5]
|
3,759,237 | 3,759,238 |
Pass Session Variable to javascript
|
<p>I'm tring to pass a session variable to javascript but not have success.
Searching stackoverflow i have found this discussion:
<a href="http://stackoverflow.com/questions/7363432/passing-session-variables-to-javascript">Passing Session variables to javascript</a></p>
<p>in my custom.js i have on header</p>
<pre><code><?php session_start(); ?>
.. /// js code
strActionPage = CurrentPath + "upload_file.php?ation=store&session_user_id=<?php echo $_SESSION['session_user_id']; ?> "; //the ActionPage's file path
</code></pre>
<p>but i cant get session variable from upload_file.php page</p>
<p>where do I wrong?</p>
<p>Tks to all</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,684,604 | 2,684,605 |
Can I assign the value like this?
|
<pre><code> Exactly I ned to do something like this is this possible?
<%
var Controller = null;
if (Model.ID== "ABC")
{
Controller = "Name";
}
else
{
Controller = "Detail";
}
%>
<% using (Html.BeginForm("edit", Controller, FormMethod.Post, new { @id="exc-" + Model.SID}))
{%>
<%= Html.Summary(true)%>
</code></pre>
<p>is this possible?
if i do I am getting exception...</p>
<p>ERROR: Cannot assign to an implicitly-typed local variable</p>
|
c# asp.net
|
[0, 9]
|
1,356,894 | 1,356,895 |
jQuery - why does delegate propagate, even after ``e.preventDefault();`` is called?
|
<p>I have a div with a nested link. The div has a <code>delegate</code> handler for <code>'click'</code>, which alerts "Div". The link within the div also has a <code>delegate</code> handler for <code>'click'</code> wherein <code>e.preventDefault();</code> is called before alerting "Link". When I click the link, I see the "Div" alert, and the "Div" alert. I'm unclear why this is happening since I'm attempting to stop propagation from the link's click handler.</p>
<h3>JavaScript</h3>
<pre><code>$('body').delegate('.outer', 'click', function(e){
e.preventDefault();
alert('Div');
});
$('body').delegate('.outer a', 'click', function(e){
e.preventDefault();
alert('Link');
// Note: I've also tried returning false (vs using preventDefault), per the docs
});
</code></pre>
<h3>HTML</h3>
<pre><code><div class="outer">
<a href="#">Click me</a>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,006,081 | 2,006,082 |
add class "last" to every div number 4 , 8 , 12 , 16 etc
|
<p>how to add class "last" to every div number 4 , 8 , 12 , 16 etc .
i think this is not big problem right ?</p>
<p>Before :</p>
<pre><code><div id="main">
<div>Element 1</div>
<div>Element 2</div>
<div>Element 3</div>
<div>Element 4</div>
<div>Element 5</div>
<div>Element 6</div>
<div>Element 7</div>
<div>Element 8</div>
<div>Element 9</div>
<div>Element 10</div>
<div>Element 11</div>
<div>Element 12</div>
</div>
</code></pre>
<p>After </p>
<pre><code><div id="main">
<div>Element 1</div>
<div>Element 2</div>
<div>Element 3</div>
<div class="last">Element 4</div>
<div>Element 5</div>
<div>Element 6</div>
<div>Element 7</div>
<div class="last">Element 8</div>
<div>Element 9</div>
<div>Element 10</div>
<div>Element 11</div>
<div class="last">Element 12</div>
</div>
</code></pre>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
4,162,467 | 4,162,468 |
more concise jquery for multi button controlling visibility of same div
|
<p>I have 3 buttons that control the visibility of 1 div.</p>
<p>we want to do following to div:</p>
<ul>
<li>show the first time any of three buttons are clicked</li>
<li>show if button clicked is different to previously button click</li>
<li>hide if button clicked is the same as previous clicked and if div is currently visible</li>
<li>show if button clicked is the same as previous clicked and if div is currently invisible</li>
</ul>
<p>currently I have this:</p>
<pre><code>//$('#alert_area') = target div
$button = $('.button')
if ($button.attr('id') != $('#alert_area').attr('showing')){
$('#alert_area').show()
}else{
if ($('#alert_area').is(":visible")){
$('#alert_area').hide();
}else{
$('#alert_area').show();
}
}
$('#alert_area').attr('showing', $button.attr('id'))
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,073,158 | 2,073,159 |
Rename Pdf from Pdf title
|
<p>Dear all:
I want to organize my pdf file downloaded from the internet. It is clear that many of them are ill-named. I want to extract the real title from the file. Here many of them are generated from Latex and I think from the compiled pdf we can find the \title{} keyword or something like that. I want then use this to rename the file.</p>
<p>I can read the meta-data using pypdf. But most pdf does not contains that title in its metadata. I have tried it with all my collections and find none! </p>
<p>Two questions:
1. Is it possible to read pdf title compiled from the pdf compiled from latex.
2. Which library(mainly in C/C++, java, python) can I use to get that information.</p>
<p>Thanks in advance.</p>
|
java c++ python
|
[1, 6, 7]
|
495,695 | 495,696 |
What are "multiple processes" in PHP?
|
<p>"I would prefer it to be written in PHP or Java (I know PHP can't do multiple threads, but it could be accomplished with multiple processes)".</p>
<p>What does this statement mean when it says "multiple processes"? Are there any good examples out there?</p>
|
java php
|
[1, 2]
|
5,038,338 | 5,038,339 |
jquery change method to trigger hidden file input
|
<p>I have created a fake file input using an anchor tag and placed a hidden file input beside this, I want to use jquery to add a click event to the anchor tag that triggers the activation of the hidden input box but Im not completely sure how to achieve this, if anyone could give me some advice that would be great.</p>
<p>Here is my current effort <a href="http://jsfiddle.net/kyllle/CdXP9/" rel="nofollow">http://jsfiddle.net/kyllle/CdXP9/</a></p>
<p>I guess Im probably way off with this one, would love some advice on how this can be achieved though</p>
<p>Kyle</p>
|
javascript jquery
|
[3, 5]
|
1,992,442 | 1,992,443 |
A simple secenario to implement JavaScript ASP.NET C#, question rephrased
|
<p>I had asked this question before, but I got no correct answer.</p>
<p>So, this is a simple thing:</p>
<pre><code>textbox.text='user typing';
</code></pre>
<p>Button: store the value to a variable and a database.</p>
<p>Very simple, nothing to it.
But there should be no post back, that is the page must not load again.</p>
<p>Try Ajax? I tried it, but it is not working.</p>
<p>I lost a lot of time trying to implement this using JavaScript Ajax and read many many posts. </p>
<p>But for some reason I cannot implement the functionality correctly.</p>
|
asp.net javascript
|
[9, 3]
|
2,462,399 | 2,462,400 |
Browser & OS as body class
|
<p>I would like to have the OS and the Browser in the body class. I need that for pixelperfect styling, because the fonts do not behave the same way in different OS / Browser configurations. After some googling and experimenting. The only way i could think of to do this was to use an indexOf...</p>
<pre><code>var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("webkit") != -1) return 'Webkit';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
</code></pre>
<p>i think its not a very beautyful solution. Is there some regex that could do this? Or is there any faster way to do this?</p>
|
javascript jquery
|
[3, 5]
|
5,244,966 | 5,244,967 |
changing text for an input field using php, mysql, and javascript
|
<p>Ok, i have some data that is being populated via a php query to a database. I am getting comments that a user enters. I am displaying the returned data in a variable as shown below. If a comment does not exist then it would display an "add comment" link. The comment is just displayed as text at first. If a comment exists then it would display the comment along with an "edit" comment" link.</p>
<p>This is the functionality i am looking to have: 1) when you click on "add comment" an input field would be displayed to the left of the "add comment" link and that link would then turn in to two links that read "save" and "cancel". I know how to do the save link but i would like to know how to make the "cancel" link revert the area back to just having the "add comment" link. 2) when you click on "edit comment" then i would like the same functionality with an input field and the "save" and "cancel" links; however, i would like the input field to be pre-populated with the comments text that is being pulled via the comments variable. I'm thinking maybe this can be done with some css display toggling none and block/inline. Not sure exactly though. Any help is greatly appreciated!</p>
<p>PHP Code:</p>
<pre><code>if(!$comments){
echo "<span style='font-size:12px;'>[<a href='#'>Add a Comment</a>]</span>";
}else{
echo "<span style='font-size:12px;'>NOTES: " . $comments . " [<a href='#'>Edit Comment</a>]</span>";
}
</code></pre>
<p>One final question: how should i handle if the comments have special characters or quotes? Actually i guess i'll need to worry about those before teh variable is created, correct? How do i do that? Thanks so much!</p>
<p>UPDATE: I appreciate the help on handling special characters, but i really need the first two questions answered more. Thanks for any more help anyone can provide me!</p>
|
php javascript jquery
|
[2, 3, 5]
|
670,199 | 670,200 |
alert shows undefined in javascript when passed value form aspx.cs page
|
<pre><code> string locationName = "Mumbai";
Page.ClientScript.RegisterStartupScript(Type.GetType
("System.String"), "addScript", "PassValues(" + locationName + ")", true);
</code></pre>
<p>in javascript my code contains</p>
<pre><code><script language="javascript" type="text/javascript">
function PassValues(locationName)
{
var txtValue = locationName;
alert(txtValue);
}
</script>
</code></pre>
<p>Here the alert shows undefined instead of "Mumbai" </p>
|
c# javascript asp.net
|
[0, 3, 9]
|
27,609 | 27,610 |
How to rewrite the Jquery dynamic selection box script for 5 selection boxes?
|
<p>I am trying to create dynamic selection boxes with Jquery.</p>
<p>Due to requirements, I have 5 selection boxes with similar Class contents e.g. Class A, Class B, Class C, etc. I have another 5 Student selection boxes besides each of the Class selection boxes. </p>
<p>So the idea is that when I select a class selection box, javascript will check on the selection and proceed to send the selection value using GET action, and return the contents for my Student selection box.</p>
<p>I already have a working script. But it is only working for one Class selection box, and if I need to have it running for the rest of the 4 Class selection boxes, I will have to create 4.js script with the different values. </p>
<p>May I know is there any way that I could just use 1 js and works for all the 5 Class selection boxes? Maybe a loop, or etc?</p>
<p>Working js for 1 selection box:</p>
<pre><code>function class_change() {
$('#class1').change(update_students);
// the rest of the class sel boxes are named as #class2 #class3, etc.
}
function update_students() {
var class = $('#class1').val();
var seat = $('#seat1').val();
$.get('getStuds.php?seatno='+seat+'&class='+class, showStudents);
}
function showStudents(result) {
$('#show_student1').html(result);
}
$(document).ready(class_change);
</code></pre>
<p>Thank you very much.</p>
|
javascript jquery
|
[3, 5]
|
4,671,791 | 4,671,792 |
Simple email validation w/ jQuery
|
<p>I have a form that is being generated dynamically with PHP.</p>
<p>There's are multiple fields for email. I would like to conduct a very basic email validation when the form loads with the data pre-filled. Those fields that contain malformed emails need to be highlighted and form submission disabled.</p>
<p>Here's what I've got so far, but I'm not sure how to get it all to work.</p>
<p><strong>JS</strong></p>
<pre><code>function validateEmail(email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
return emailReg.test( email );
}
$("#mySubmitButton").click(function() {
var email = jQuery("input[name=\'email[]\']").val();
if (!validateEmail(email)) {
event.preventDefault();
$(this).css("border","1px solid red");
alert("Bad email. Please correct before submitting.");
}
});
</code></pre>
<p><strong>PHP</strong></p>
<pre><code>$pairs = array_filter(explode(",", $_POST['email']));
foreach( $pairs as $pair ) {
$i++;
echo '<input type="text" name="email['.$i.']" value="'.$output['1'].'">
}
</code></pre>
|
php jquery
|
[2, 5]
|
5,437,924 | 5,437,925 |
getting an espacial part of a string in c++
|
<p>how can I get an especial part of a string or an array or a vector in C++?
in python it is in this way:</p>
<pre><code>a = "hello" #string
b = [1,2,3,4,5] #list
a[1:4] #from index 1 to 4
b[2:4] #from index 2 to 4
</code></pre>
<p>result:</p>
<pre><code>"ell"
[3,4]
</code></pre>
<p>is there any such syntax for C++?</p>
|
c++ python
|
[6, 7]
|
1,775,482 | 1,775,483 |
Run jQuery function on drop down change
|
<p>I have a jQuery function that current runs on Click. I need to change it so that it runs when a drop down box is changed. Here is my code:</p>
<pre><code><form id="form1" name="form1" method="post" action="">
<label>
<select name="otherCatches" id="otherCatches">
<option value="*">All</option>
</select>
</label>
</form>
</code></pre>
<hr>
<pre><code>$("#otherCatches").click(function() {
$.ajax({
url: "otherCatchesMap.php>",
success: function(msg) {
$("#results").html(msg);
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,918,198 | 4,918,199 |
How to create a .csv file in asp.net?
|
<p>How to Create a .CSV file from the reading the database in asp.net?Can any one suggest me how to create the .CSV file in asp.net?</p>
<p>Thanks in Advance.</p>
|
c# asp.net
|
[0, 9]
|
586,785 | 586,786 |
check what checkboxes are checked and then send an ajax request
|
<p><strong>background on the topic</strong> </p>
<p>ok ive been coding a messaging page which users come on to check their messages,this is done without moving from the page so it uses ajax and json calles to get the data through <strong>jquery</strong> </p>
<p>my question is </p>
<p><strong>If their a way of checking what checkboxes are *<em>checked</strong> and then return there "ids" oh and their could be upto a 100 checkboxes if the user is lazy and doesn't clean his inbox</em>* </p>
<p>if you want to look at what i mean go to <a href="http://125.239.244.47/social/" rel="nofollow">http://125.239.244.47/social/</a>
and login with the user <strong>test</strong> and the password is nothing(not the word)
and goto messages on the front page when you login
thanks for your help</p>
|
javascript jquery
|
[3, 5]
|
1,473,718 | 1,473,719 |
Automatic redirection to start page-C# asp.net
|
<p>In gridview ,there is a templatefield which is imagebutton.i'm binding imageurl at runtime(on pageload) based on the document type.if i'm not binding the image,on next postback it loads the startup page.can somebody give the reason for this?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
3,132,851 | 3,132,852 |
Send/Receive byte[] via TCP Socket
|
<ol>
<li>I would like to send/receive sqlite database files (*.db) in byte[] over TCP socket connection? <br/></li>
<li>Is there a similar method in Java/Android for Socket.Poll() C#?</li>
</ol>
<p>I'm new in Java / Android</p>
|
java android
|
[1, 4]
|
1,332,839 | 1,332,840 |
Java POST and GET arrays
|
<p>Let's assume I have a form with these fields (HTML)</p>
<pre><code><input type="text" name="user[name]" value="name"/>
<input type="text" name="user[email]" value="email"/>
<input type="text" name="user[age]" value="age"/>
</code></pre>
<p>how do I get this information inside a java Servlet? </p>
<p>In php it is just </p>
<pre><code> $_POST["user"]["name"]
</code></pre>
<p>or </p>
<pre><code> $_GET["user"]["name"]
</code></pre>
<p>I am not referring at simple field like</p>
<pre><code> <input type="text" name="user" value="jimmy"/>
</code></pre>
<p>I am referring at retrieving arrays of data, like in the case of a set of checkboxes or a multiple select.</p>
|
java php
|
[1, 2]
|
3,636,330 | 3,636,331 |
looping through elements in jquery
|
<p>I've got a page with bunch of drop downs and each drop down has a button next to it. When the page initially loads I want all the buttons to be disabled and if there is a change to a specific drop down then its corresponding button shall be enabled. </p>
<p>I've got the following code down for this but I need to know how to loop through all the drop downs and buttons so I can generalize it. </p>
<pre><code>$(document).ready(function () {
//disable all buttons
function disableAllButtons () {
$(':input[type=button]').attr("disabled", "true");
}
disableAllButtons();
//enable button when drop down changes
$(':input[name=sNewPKvalue1]').focus(function() {
disableAllButtons();
$(':input[name=Update0]').removeAttr("disabled");
})
//enable button when drop down changes
$(':input[name=sNewPKvalue2]').focus(function() {
disableAllButtons();
$(':input[name=Update1]').removeAttr("disabled");
})
////.....question?
});
</code></pre>
<p><strong>Question</strong></p>
<p>If I have 12 dropdowns and 12 buttons</p>
<p>How do I loop through all the drop downs with name <code>sNewPKvalue[1-12]</code> and all the buttons with name <code>Update[0-11]</code></p>
|
javascript jquery
|
[3, 5]
|
5,861,937 | 5,861,938 |
Javascript update before page loads in ASP.NET
|
<p>I'm trying to update values from a xml file into textboxes. I have this javascript being called in the Page_Load event</p>
<pre><code>this.Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", sb.ToString(), true);
</code></pre>
<p>I click the continue button which does a post back but the values are not updated until I refresh the page again which makes me think the js isn't being run until after the page is returned. I'm wondering how to have the values updated when the page is refreshed after the button postback.</p>
<p>thanks</p>
|
asp.net javascript
|
[9, 3]
|
2,667,222 | 2,667,223 |
Combining C++ and C#
|
<p>Is it a good idea to combine C++ and C# or does it pose any immediate issues?</p>
<p>I have an application that needs some parts to be C++, and some parts to be C# (for increased efficiency). What would be the best way to achieve using a native C++ dll in C#?</p>
|
c# c++
|
[0, 6]
|
2,761,991 | 2,761,992 |
Session Variable problems when storing an object in my Session
|
<p>I have a log in page where I valid my users and based on this validation I store their user info in a session variable so I can access it at any time. To do this I am trying to store an instance of one of my dbml generated classes "UserInfo". So I populate the class and then store it in a session variable I call "user"</p>
<pre><code> UserInfo u = new UserInfo();
u = dal.RetrieveUser(userID, userPass)
Session["user"] = u;
</code></pre>
<p>The issue I am having with this is it seems to mix up these session variables between users. Or more specifically it always seems to take the information from the first user variable stored for each subsequent user that logs in. So user 1's info is being pulled in for User 2, User 3, etc...</p>
<p>Is my problem that my class "UserInfo" is somehow static? Or what is causing this to happen? My UserInfo class looks like this:</p>
<pre><code>public partial class UserInfo
{
...
</code></pre>
<p>EDIT:
After further review it seems that my Session variables are in fact working properly but my custom menus are actually the problem.</p>
|
c# asp.net
|
[0, 9]
|
2,283,402 | 2,283,403 |
TextEdit Text Input Issues in my game
|
<p>I am working on an Android game and am currently trying to get text input working. I want to prompt the player to enter his or her name and have that name added to the high score list.</p>
<p>I am trying to do that through EditText which I can get to work if I put my code in the onCreate method, but not if I call it from my game loop.</p>
<p>The method I am currently using:</p>
<pre><code>public static void getInput(Context context)
{
final AlertDialog.Builder alert = new AlertDialog.Builder(context);
final EditText input = new EditText(context);
alert.setView(input);
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton)
{
String value = input.getText().toString().trim();
}
});
alert.setNegativeButton("Cancel",
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton) {
dialog.cancel();
}
});
alert.show();
}
</code></pre>
<p>If I call this from my gameloop the game crashes and I get the error:</p>
<pre><code>01-26 06:33:21.413: ERROR/AndroidRuntime(6960): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
</code></pre>
<p>I tried calling Looper.prepare() and then Looper.loop(), and that opened up the text input box, but when I closed the box my game just sat on a black screen and did not respond.</p>
<p>So, my question is: what am I doing wrong, and is there an easier way to get text input? My game is based off the LunarLander example, so I am using SurfaceView.</p>
<p>Any help or suggestions will be appreciated. Thank you :)</p>
|
java android
|
[1, 4]
|
5,605,077 | 5,605,078 |
drop down list in a text box
|
<p>i want to show the details of a student who entered into the library in a text box like drop down when the mouse is placed over it</p>
|
java javascript
|
[1, 3]
|
5,811,153 | 5,811,154 |
How to scale with ImageView?
|
<p>Does it call scale? I need to use the zoomable function as what we do in browser with two finger. It seem zoom controls restricts alot on ImageView though. My images are in drawable, so i assume calling them through (R.drawable.myimage);</p>
<p>and btw im displaying my image with .setContentView(R.layout.myxml);</p>
|
java android
|
[1, 4]
|
5,939,963 | 5,939,964 |
formating number to currency with commas in jquery with slider
|
<p>I'm trying to get the output formatted like 1,023,456.50 also for ui.values[ 0 ]
But it shows NaN.
Any ideas?</p>
<p><a href="http://jqueryui.com/slider/#range" rel="nofollow">http://jqueryui.com/slider/#range</a></p>
<pre><code>$(function() {
$( "#slider-range" ).slider({
animate: true,
range: true,
min: 0,
max: 10000000,
step: 10000,
values: [ 2000, 8888888 ],
slide: function( event, ui ) {
$( "#price-range" ).val( + ui.values[ 0 ].toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") + " - " + ui.values[ 1 ].toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") );
}
});
$( "#price-range" ).val( + $( "#slider-range" ).slider( "values", 0 ).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") +
" - " + $( "#slider-range" ).slider( "values", 1 ).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") );
});
</code></pre>
<p>For the original Code please see : <a href="http://jqueryui.com/slider/#range" rel="nofollow">enter link description here</a></p>
|
javascript jquery
|
[3, 5]
|
4,720,605 | 4,720,606 |
jQuery - getJSON data to array
|
<p>How do you store the data received from jQuery getJSON to an array for later usage? </p>
<p>Here's a sample snippet - somehow the loop's <code>data</code> is not being stored to the global <code>haikus</code>.</p>
<pre>
<code>
$(document).ready(function(){
var haikus=[];
alert("begin loop");
$.getJSON('http://haikuennui.com/random.php',function(data){
var i=0;
for(i=0;i<data.length;i++){
haikus[i]=[data[i].id,String(data[i].username),String(data[i].haiku)];
}
alert(haikus[0][1]);
});
})
</code>
</pre>
<p><a href="http://jsfiddle.net/DMU2v/" rel="nofollow">http://jsfiddle.net/DMU2v/</a></p>
|
javascript jquery
|
[3, 5]
|
724,981 | 724,982 |
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,709,556 | 3,709,557 |
localization in asp.net-HTML controls
|
<p>In my application i need different culture for HTML controls.
is it possible through the .resx file or is there anyother methods.</p>
<pre><code> <ul>
<li><a href="..">Home</a></li>
<li><a href="#">Admin</a></li>
<li><a href="#">View List</a></li>
</ul>
</code></pre>
<p>How to apply localization for all the pages from master page?
or whether i need to apply the code for all the pages?
is there any method for applying the localization for javascript and Jquery other than creating separate script for different languages.</p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
1,668,591 | 1,668,592 |
how to put validation for radiobuttonlist's radiobutton ?
|
<p>Here i have gridview which contain some values retrieved from database.We put radiobutton list for each row which contain 4 radiobutton in each row.
For particular row , i wish to disable that 4 radiobuttons.
For that , i tried following code ...But It doesn't work....</p>
<pre class="lang-cpp prettyprint-override"><code>if (j == 0) {
dtrelative.Rows.InsertAt(rd3, 0);
// rBtnList.Items[0].Enabled = false;
//rBtnList.Items[0].Attributes.Add("Enabled","False");
////rBtnList.Items[1].Attributes.Add("Enabled", "False");
////rBtnList.Items[2].Attributes.Add("Enabled", "False");
////rBtnList.Items[3].Attributes.Add("Enabled", "False");
//rtButton.Attributes.Add("Enabled", "False");
rBtnList.HasAttributes.Equals(rtButton).GetType();
rtButton.Enabled = false;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,746,183 | 1,746,184 |
after() with fadein() jquery doesn't work
|
<p>I am trying to append some extra rows to my table, but can't make it fancy with fadein().
As you can see mine is applying the fade in effect to the very first row.</p>
<p><a href="http://jsfiddle.net/r5q6r/" rel="nofollow">Jsfiddle example</a></p>
<p>How can I apply the fadein to my other 3 rows??</p>
<p>I switched the places of the methods, but no success</p>
<pre><code>$("input").click(function () {
$("table tr:last")
.hide()
.after("<tr><td>SecondRow</td></tr><tr><td>ThirdRow</td></tr><tr><td>ForthRow</td></tr>")
.fadeIn(1000);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,552,650 | 1,552,651 |
pass multidimentional array from javascript to php
|
<p>Im running a javascript code which reads values from different XML files and it generates a multidimentional array based on those values. Now I need to pass this array to a PHP page. I tried different but it always pass the arrray as string not as an array.
Anyone has an idea :( ... and thank you very much</p>
|
php javascript
|
[2, 3]
|
1,594,842 | 1,594,843 |
Do I have to use JavaScript?
|
<p>When does it become unavoidable and when would you want to choose JavaScript over server side when you have a choice?</p>
|
asp.net javascript
|
[9, 3]
|
5,056,786 | 5,056,787 |
Javascript: Clicking a wrapper element but not a child element
|
<p>I am writing some javascript (jQuery) that enables a div wrapped around a checkbox, when clicked, will toggle the checkbox element. However, the problem I'm running into is that when you click on the checkbox, it doesn't work because it's being toggled twice (at least I think that's what's happening). </p>
<p><a href="http://jsfiddle.net/misbehavens/WV7sp/" rel="nofollow">Here's a demo.</a></p>
<p>Here's the code:</p>
<pre><code>$('.checkbox-wrapper').click(function(){
var $checkbox = $(this).find('input[type="checkbox"]');
if ($checkbox.is(':checked')) {
$checkbox.attr('checked', false);
} else {
$checkbox.attr('checked', true);
}
});
</code></pre>
<p>How can I make it so that clicking the checkbox works as normal, but if you click in the surrounding area, it toggles the checkbox?</p>
<h2>Solution:</h2>
<p>Thanks to jAndy's comment for showing how this can be done by checking the event.target property:</p>
<pre><code>$('.checkbox-wrapper').click(function(e){
if( e.target.nodeName === 'INPUT' ) {
e.stopPropagation();
return;
}
var $checkbox = $(this).find('input[type="checkbox"]');
if ($checkbox.is(':checked')) {
$checkbox.attr('checked', false);
} else {
$checkbox.attr('checked', true);
}
});
</code></pre>
<p>And as others have pointed out, this may not be the best example since you get the same functionality (without needing javascript) by wrapping the checkbox with a label tag instead of a div tag. <a href="http://jsfiddle.net/misbehavens/cuhwE/" rel="nofollow">Demo</a></p>
|
javascript jquery
|
[3, 5]
|
5,691,146 | 5,691,147 |
jquery , asp.net
|
<p>I am trying to use jquery to select a checkbox when another checkbox is selected. This wuld have been easy if the ids of the checkboxes are constant but they can change so I have tried to use classes instead, unfortunately asp.net applies the class name on the span element wrapping the checkbox instead of applying on the checkbox directly, so i need to get the checkbox via the inner element of the parent span </p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
$('#ctl00_ContentPlaceHolder1_Category_ctl00_ProductBusinessLine_chkEL_157').click(function() {
if (this.checked) {
var pl = $('#ctl00_ContentPlaceHolder1_Category_ctl00_ProductBusinessLine_chkPL_313')
pl.attr("checked", true);
}
})
});
</script>
</code></pre>
<p>My code, previously working with the checkbox ids, is above, pls help!</p>
|
asp.net jquery
|
[9, 5]
|
2,029,741 | 2,029,742 |
Error with selected item from the ListBox property (C#)?
|
<pre><code>for (int counter = 0; counter < countSelected; counter++)
{
string groupName = txt_GroupName.Text;
//Get GroupID from the created group
string GroupIDQueryText = "SELECT GroupID FROM tbl_group WHERE GroupName ";
int groupID = Convert.ToInt32(server.performQuery(GroupIDQueryText, groupName, MySqlDbType.VarChar));
//To get User ID
string firstName = ListBoxMembers.SelectedItems[counter].Value;
}
</code></pre>
<p>This isn't returning the selected value, but instead returns the 1st person in the list even if I haven't selected it. Where am I going wrong?
System.Web.UI.WebControls does not contain defenition for listboxmembers.selectedItems error </p>
|
c# asp.net
|
[0, 9]
|
26,981 | 26,982 |
javascript validation of textbox in asp.net
|
<p>i have one text box and button in asp.net like</p>
<pre><code><tr>
<td style="width: 100px">
<asp:Label ID="lbltime" runat="server" Text="Enter Time"></asp:Label>
</td>
<td style="width: 100px">
<asp:TextBox ID="Txttime" onkeypress="return isNumberKey(event)" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px" align="center">
<asp:Button ID="Btntime" runat="server" Text="Button" />
</td>
</tr>
</code></pre>
<p>now i want to write javacript code to validate on my textbox which work when i click on button
now i want to know hopw to call fuction of javascript in button and
the funtion should do work like is
button should send the text box value to the fuction and function should check the value to integer number only. nad if not found should give the error message in the dialog box that "please enter value in integer only"</p>
<p>i m trying the javascript like this</p>
<pre><code>function isNumberKey(textboxvalue)
{
evt=textboxvalue.text;
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
textboxvalue.text="Enter in Integer Only";
return false;
return true;
}
</code></pre>
|
javascript asp.net
|
[3, 9]
|
3,949,429 | 3,949,430 |
How to create .net webservices for retriving data from sql server and display it on android application
|
<p>i am developing an android application for MCX in which i need show data on android app screen where data is stored on MS SQL Server. i am also creating a web application in asp.net c# from which data will be insert and update in that MS SQL Server.
so i need tips to do this overall task please give a solution so i can complete this.</p>
<p>thanks in advance </p>
|
android asp.net
|
[4, 9]
|
868,910 | 868,911 |
index of element in regard to elements of same type?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/11423357/get-position-of-selected-elements-not-index-of-element-in-dom">Get position of selected elements, not index of element in DOM</a> </p>
</blockquote>
<p>Using JQuery, what is the optimal way to get the index of an element in regard to other siblings of the same type, disregarding siblings of other types?</p>
<pre><code><span/>
<span/>
<div/>
<span/> <-- index of this guy in regard to just span tags? (answer: 2)
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,487,726 | 2,487,727 |
How to show MessageBox on asp.net?
|
<p>if I need to show a MessageBox on my ASP.NET WebForm, how to do it?</p>
<p>I try: <code>Messagebox.show("dd");</code></p>
<p>But it's not working.</p>
|
c# asp.net
|
[0, 9]
|
648,950 | 648,951 |
jquery unbind toggle event don't work
|
<p>i have a div element generate in runmode by javascript
I want first click show confirm message and next click remove click event
but die or unbind don't work!</p>
<pre><code>$('div').live('click',function(e) {
$(this).toggle(function () {
$(this).html("I'm sure!");
return false;
},
function (e) {
$(this).html("Deleting...");
$(this).die('click').die('click');
}).trigger('click');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
634,682 | 634,683 |
Create object property names using loop and input textboxes
|
<p>I am refactoring some code where I grab the values inputted into textboxes and use said values for calculations. The problem is rather than using document.getElementByID multiple times I want to loop through each textbox on the page and assigning each value to this object which I will pass to my calculation functions. I would also like to set the property names of this object by looking at the input textbox IDs and using the ID strings for the object property names.</p>
<p>See code below:</p>
<pre><code>$(document).ready(function() {
var calcObj = new Object();
$("input[id^='txt']").each(function(i, val) {
calcObj[i] = this.value;
});
$.each(calcObj, function(i, val) {
// alert(val);
});
});
</code></pre>
<p>As you can see when document is ready, object is created. There is a jquery .each loop to go through every input with id that contains txt. I am assigning this.value to object where index is i. </p>
<p>So I want to some how name the properties of this object and assign value so I can reference object property name elsewhere in the code where I pass this object to another function.</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
205,809 | 205,810 |
Reduce power conssumption while wireless should be used
|
<p>I am working on my MSc dissertation right now. This dissertation has one related app which should be developed by android. One of the objectives of the research is about using wireless to sync data among the phones. In the meanwhile, I must consider power consumption which means reduce power consumption while using wireless. I am thinking about 3 possible wireless technologies for this app:</p>
<ul>
<li>wifi direct (p2p wifi) - fast, reliable, but not supported on many phones (even ones with Android >=4.0) (you would also probably need to two devices to test/develop this)</li>
<li>regular wifi - fast, reliable, but requires at least an access point (i.e. some infrastructure, or another mobile device acting in part as an access point but does NOT Need internet access), code partially compatible with wifi direct</li>
<li>Bluetooth - slow, unreliable, supported on most devices, requires no infrastructure (also probably need two devices to develop), code least </li>
</ul>
<p>Regarding these mentioned wireless technologies, I have few questions listed below (please consider that I need acceptable evidences or documentations to support my ideas):</p>
<ol>
<li>Which of these technologies consume less power?</li>
<li>How can I reduce power consumption in android phone?</li>
<li>Are there any practical strategies available in this case regardless of coding? For example consider sth in setting of the app or sth else?</li>
</ol>
|
java android
|
[1, 4]
|
3,121,839 | 3,121,840 |
Asp.net crystal report (dynamic change)
|
<p>hi all !
I am developing one asp.net application and the requirement is as below.
user can view multiple reports(i have used crystal reports). Each report has edit report button.when the user click on edit button,then report will be open in <strong>excel</strong> sheet on different webpage.then user make suitable changes like sorting etc and save this report and take an updated print.</p>
|
c# asp.net
|
[0, 9]
|
5,365,214 | 5,365,215 |
what's the best way to apply a mask to an EditText on Android?
|
<p><br/>
what's the best way to mask a EditText on Android? <br/>
I Would like my EditText to behave like this decimal number input <a href="http://www.meiocodigo.com/projects/meiomask/#mm_demos" rel="nofollow">here</a>.
Is there a easy way to do this? </p>
|
java android
|
[1, 4]
|
3,649,331 | 3,649,332 |
Sending lat and long to python server
|
<p>What if i want to send this data to my server Python After i already
open a connection and i want to send tis string , so here is my code , how to be able to send this </p>
<pre><code>String Text = "My current location is: " +
"Latitud =" + loc.getLatitude()+
"Longitud =" +loc.getLongitude() ;
</code></pre>
|
android python
|
[4, 7]
|
1,354,465 | 1,354,466 |
Add class to last div when it exists
|
<p>I have the following HTML structure, I want to add a class to the last <code><div></code> which contains the <code><p></code> tag but only when it exists. </p>
<pre><code><div id="view">
<div class="login">
</div>
<div>
<p>Add a class to this parent DIV</p>
</div>
</div>
</code></pre>
<p>Any suggestions?</p>
|
javascript jquery
|
[3, 5]
|
5,220,537 | 5,220,538 |
passing value to another page using javascript
|
<p>Hello every I want to pass a message from php to JavaScript function and then redirecting to another page i want to show that message . Plz help me out . here is the sample code</p>
<pre><code>Php
if ($result){
$success = "New Page has been added successfully.";
} else {
$error = "Unable to process at this time.";
}
Java script
<script type="text/javascript">
window.location="admin.php?page=add_user";
</script>
</code></pre>
<p>i want this &success message on another page by using this javascript function . i have tried in this way </p>
<pre><code>window.location="admin.php?page=add_user&<?php echo $success?> ";
</code></pre>
|
php javascript
|
[2, 3]
|
3,949,529 | 3,949,530 |
Get the whole document's html with JavaScript/JQuery
|
<p>I know it's already discussed here, but there were no solution to get the whole document (including doctype).</p>
<p><code>$(document).html();</code> returns <code>null</code>...</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.