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,403,477
2,403,478
Can I change a asp control from image handler?
<p>I have an asp page with a button on it that uses an image handler to show a jpg. Can I disable a button on the page from the image handler base on what image is loaded. for example if c:/x.jpg is loaded, disable the button.</p> <p>Thanks Charles</p>
c# asp.net
[0, 9]
1,580,597
1,580,598
Back button press twice before quitting app
<p>How can I configure the back button to be pressed twice before the app exits? I want to trigger </p> <pre><code>@Override public void onBackPressed() { //custom actions //display toast "press again to quit app" super.onBackPressed(); } </code></pre>
java android
[1, 4]
3,840,859
3,840,860
Video Ad (show video then ad)
<p>Doe's anyone know how I can replicate this? I'd like to show an a promo code after the video plays on my website.</p> <p>Like the current chipotle facebook ad.</p> <p><a href="http://apps.facebook.com/videocoupon/" rel="nofollow">Facebook Ad</a></p>
php jquery
[2, 5]
1,202,933
1,202,934
Calling Javascript function
<p>Extending a website I didn't build. I want to be able to call the ShowWindow proc with a parameter. How would I do that? New to JQuery and Javascript.</p> <pre><code>default.aspx &lt;script type="text/javascript" src="/scripts/jquery-1.2.6.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('a#ShowWindow').click(function() { window.open("TerminalInfo.aspx?", 'Info', 'scrollbars=yes,width=510,height=536'); }) }); </code></pre> <p></p> <p>default.aspx.cs</p> <p>Building the aspx dynamically...</p> <pre><code> public static string ToHtml(this Location location) { var html = new StringBuilder(); html.Append("&lt;td&gt;&lt;a href='#' id='ShowWindow'&gt;ShowLetter&lt;/a&gt;&lt;/td&gt;"); //This works html.Append("&lt;td&gt;&lt;a href='#' id='ShowWindow(\"MyInfo.aspx\")'&gt;Read More&lt;/a&gt;&lt;/td&gt;"); //How can I do this? It doesn't work. return html.ToString(); } </code></pre>
javascript jquery
[3, 5]
4,184,858
4,184,859
Android - Internet Activity doesn't cease after app closes
<p>QA Keeps reporting a bug where after closing the app internet activity is still going. We stream video. They say after the app closes, the streaming doesn't stop because the network activity icon on the top status bar remains on for a minute after the app closes. I have checked all my streams and logs and there is no indication of network activity. Also, when my app closes we call</p> <pre><code>int pid = android.os.Process.myPid(); android.os.Process.killProcess(pid); </code></pre> <p>Also for each activity in the manifest I have set android:finishOnTaskLaunch="true" and for the main activity android:launchMode="singleTask"</p> <p>With this code, is it even possible that the app could have network activity even after it is closed and killed?</p> <p>If not, why is the network activity icon going when the app closes and how do I get rid of it?</p>
java android
[1, 4]
3,532,600
3,532,601
Disable a button on click
<p>I have a button control. Once the user clicks on it, the click event should fire and then the button should get disabled. How can I do this? I have the option to use JQuery or JavaScript or both.</p> <p>Here is my button declaration:</p> <pre><code>&lt;asp:Button ID="Button1" runat="server" Text="Click Me" onclick="Button1_Click" /&gt; </code></pre> <p>On the button click code behind, I have added a Response.Write(). That should get executed and then the button should be disabled</p>
asp.net javascript jquery
[9, 3, 5]
2,816,034
2,816,035
Asp.net + C#: Copy DataColumn from tableA to table B
<p>I would like to copy DataColumn from tableA to table B:</p> <p>As I think it should be like this:</p> <blockquote> <p>TableA in perdefined.</p> <p>DataColumn[] dataColum = new DataColumn[TableA .Columns.Count];</p> <p>TableA .Columns.CopyTo(dataColum, 0);</p> <p>DataTable TableB = new DataTable();</p> <p>TableB .Columns.AddRange(dataColum); // </blockquote> <p>=> but it raised an error at the line error, ID is belong to another table (in tableB)...</p> <p>As I dont like another way:</p> <blockquote> <p>DataTable TableB = TableA.Copy(); TableB.Clear(); // => getting structure of table A, not nice this way</p> </blockquote> <p>Any ideas? Thanks in advance!</p>
c# asp.net
[0, 9]
5,765,105
5,765,106
lock screen with browser page
<p>I am developing a online examination project on core PHP. I want that when candidate giving exam then he see only that web page. he can't see any thing else like below taskbar of operating system, can't close the browser on time of exam.</p> <p>How can i do this? please help me.</p>
php javascript jquery
[2, 3, 5]
3,472,388
3,472,389
which language / tool to use
<p>Here's the situation:</p> <p>I need to develop a desktop tool that will take in an input from Oracle (text) and it's output is a print of a layout generated by that tool.</p> <p>The tool needs to be fast and able to print easily and not much extra software required on client PC's which ALL run Windows.</p> <p>Now i've studied Java, PHP in the past however I don't want to use PHP for the Desktop App and I have my doubts about Java in regards to Printing and developing the GUI.</p> <p>It seems to me like with C# I can develop the GUI easier and faster, and most PC's have a lot of the tools required for the GUI in the OS (.net framework).</p> <p>A tool like NetBeans helps, but more often than not the GUI design is either broken or shoots across the screen when I make a simple change.</p> <p>So now I'm thinking about starting in Visual C#, however I would like to get your opinion.</p> <p>And from my past VERY short .NET programming experience, I can still remember that deploying over the internet is easy as well, with JAVA I've had some issues with that as well before I got it to work.</p> <p>So in short:</p> <ul> <li>Windows environment</li> <li>Lot of GUI design</li> <li>Fast app that runs on client Windows PC's without much 'extra' software installing</li> <li>Easy print programming</li> </ul> <p>THANK YOU!</p>
c# java
[0, 1]
749,923
749,924
How to detect control+click in Javascript from an onclick div attribute?
<p>I need to know if the user is clicking or CONTROL CLICKING a div element.. i have seen examples on how to do it using event listeners.. but my codes are already set in place, and is using an on-element <strong>onclick</strong> method.. </p> <p>HTML</p> <pre><code> &lt;div id='1' onclick='selectMe()'&gt;blah&lt;/div&gt; </code></pre> <p>JS</p> <pre><code> function selectMe(){ //determine if this is a single click, or a cntrol click } </code></pre> <p>...also would love to know if it was a left or right mouse button click.</p>
javascript jquery
[3, 5]
2,864,241
2,864,242
Communication issue between PHP and jQuery
<p>I have a page generated from PHP like this:</p> <pre><code>&lt;?php //In my original code, this is retrieved from databas.. $users = array( array('id'=&gt;1, 'login'=&gt;'login1', 'email'=&gt;'email1') ); foreach($users as $user){ echo '&lt;tr&gt;&lt;td&gt;'.$user['login'].'&lt;/td&gt;&lt;td&gt;'.$user['email'].'&lt;/td&gt;&lt;td&gt;&lt;button class="button-delete"&gt;Delete&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;'; } ?&gt; </code></pre> <p>Then, in front side I have this script: </p> <pre><code>$('.button-delete').click(function(){ var id=0; alert(id); }); </code></pre> <p>My aim is to make Delete button perform an ajax call to delete the user. Till now I didn't got there yet, my problem is how to get the user ID?</p>
php jquery
[2, 5]
4,338,543
4,338,544
How to change content of a div which toggles another div?
<p>My HTML is like this:</p> <pre><code>&lt;div&gt; &lt;div class="action"&gt;Show details&lt;/div&gt; &lt;div&gt;Some hidden details&lt;/div&gt; &lt;/div&gt; </code></pre> <p>My current JS is this:</p> <pre><code>$(".action").click(function(e) { e.preventDefault(); $(this).next("div").slideToggle('slow'); }); </code></pre> <p><strong>How can I also change the content of the <code>action</code> div to "Hide details" / "Show details" on each toggle?</strong></p> <p>So it's clear to users that clicking on the link again will close the div.</p>
javascript jquery
[3, 5]
1,441,463
1,441,464
Get the HTML that makes up an element in Jquery or Javascript?
<p>How do I get the HTML that makes up an element using Jquery or Javascript? For example if I have an element that looks like </p> <pre><code>&lt;div id="theDivIWant" class="aClassName" style="somestyle: "here"&gt;&lt;/div&gt; </code></pre> <p>I can grab a reference to it using </p> <p>var x = document.getElementById("theDivIWant") or $("#theDivIWant")</p> <p>but how can I actually retrieve the string?</p> <pre><code>"&lt;div id="theDivIWant" class="aClassName" style="somestyle: "here"&gt;&lt;/div&gt;" </code></pre>
javascript jquery
[3, 5]
5,005,127
5,005,128
displaying images in a slider
<p>I want to know is there an easy way in order to be able to place images in a loop as below in like a slider? The user sees first image in a slider and then by using arrows for example, be able to slide to next to next or previous image. If user is on last image and wants to go on next image, it displays the first image again. if user is on first image and click on previous, it goes on last image. So it stays continuous.</p> <p>Below is code where if there are no images then it displays a blank but if there are images, then displays those images in a slider:</p> <pre><code>&lt;?php //start:procedure image $img_result = ''; if(empty($arrImageFile[$key])){ $img_result = '&amp;nbsp;'; }else{ ?&gt; &lt;?php foreach ($arrImageFile[$key] as $i) { ?&gt; &lt;p&gt;&lt;img alt="&lt;?php echo $i; ?&gt;" height="200" width="200" src="&lt;?php echo 'ImageFiles/'.$i; ?&gt;"&gt;&lt;/p&gt; &lt;?php } ?&gt; &lt;?php } //end:procedure image </code></pre>
javascript jquery
[3, 5]
4,911,695
4,911,696
call function using if statement
<p>I want to be able to call a function within an if statement.</p> <p>For example:</p> <pre><code>var photo = "yes"; if (photo=="yes") { capturePhoto(); } else { //do nothing }; </code></pre> <p>This does nothing though. The function is clearly defined above this if statement.</p> <p>Edit: Wow, downboated to hell! capturePhoto(); was just an example function that didn't really need any more explanation in this scenario?</p>
javascript jquery
[3, 5]
4,047,190
4,047,191
Javascript/jquery not working on my site
<p>I'm creating a site, tested out on my local server and it worked fine, but once I moved it over ot my host anything to do with javascript/jquery on the page just refuses to work :/</p> <p><a href="http://www.neuromanga.com/mangaReader1.0.php?cid=1" rel="nofollow">http://www.neuromanga.com/mangaReader1.0.php?cid=1</a></p> <p>could someone please help me out </p>
javascript jquery
[3, 5]
2,914,683
2,914,684
Math.pow JS vs. PHP
<p>I need help to "translate" this snippet to PHP from JS.</p> <p>The original JS code is this:</p> <pre><code>result = A * ( B / 1200 ) / ( 1 - 1 / Math.pow( 1 + ( B / 1200 ), C * 12 ) ) * D; </code></pre> <p>I need this code in PHP. I try with this, but it gives me a different result:</p> <pre><code>$result = $A * ( $B / 1200) / ( 1 - 1 / pow( 1 + ( $B / 1200 ), $C * 12 ) ) * $D; </code></pre>
php javascript
[2, 3]
1,130,165
1,130,166
Why does my variable change values?
<p>I have a simple <a href="http://jsfiddle.net/a9kG8/3/" rel="nofollow">jsfiddle</a> where I get the value of a div. </p> <p>In the <code>$(document).ready(function(){})</code> section I get the text of the div just fine. When I try to use that value later on in a function, the value changes (unless I add <code>.innerHTML</code>). Why does the value of that variable change? In other words, why do I need to add <code>.innerHTML</code> when I call that variable later on?</p> <p>thanks! </p> <pre><code>&lt;div id="my_div"&gt;1&lt;/div&gt; // Javascript/JQuery $(document).ready(function(){ var my_div = $("#my_div").text(); alert(my_div); func(); }); function func(){ alert(my_div); // why does the value change here...why??? alert(my_div.innerHTML); // why do I need ".innerHTML' here??? }; </code></pre>
javascript jquery
[3, 5]
4,580,741
4,580,742
jquery extract <meta property="og:url"
<p>is it possible to extract the meta data from a page loaded via ajax.</p> <p></p> <p>I tried $("meta") as my selector but it doesn't work?</p> <p>Any help would be greatly appreciated.</p> <p>A</p> <p>this is my code</p> <pre><code>$.ajax({ url: obj ,success: function(responseText){ var $response=$(responseText); console.log($response.find("meta").html()); } }); </code></pre>
javascript jquery
[3, 5]
5,065,512
5,065,513
Window operations with JQuery?
<p>I want to open a new window with width 600 and height 300</p> <p>Does jquery have a function to do it ? </p>
javascript jquery
[3, 5]
5,911,599
5,911,600
Accesing contents of res/raw programatically (Android)
<p>I'm working on an app for Android with a few other people, and the primary content is specified by our designers as text files in a certain file format, which we then parse, process, and serve in the app. We're currently storing them in <code>res/raw</code>.</p> <p>This makes things great for the designers because when they want to add content, they simply add a file to <code>res/raw</code>. This is annoying as a developer, however, since we developers then need to add <code>R.raw.the_new_file</code> to an array in the code specifying which files to process at startup.</p> <p>Is there a way to access the resource ID's of <code>res/raw</code> programatically? Ideally when the application starts, we could make a call to see which files are in <code>res/raw</code>, process all of them, so we could eliminate the small overhead with matching up the contents of <code>res/raw</code> with that of our array in the code.</p> <p>The most promising path I've seen is <a href="http://developer.android.com/reference/android/content/res/Resources.html#getAssets()" rel="nofollow"><code>getAssets</code></a> from <a href="http://developer.android.com/reference/android/content/res/Resources.html" rel="nofollow">Resources</a>, which would let me call <a href="http://developer.android.com/reference/android/content/res/AssetManager.html#list(java.lang.String)" rel="nofollow"><code>list(String)</code></a> on the <a href="http://developer.android.com/reference/android/content/res/AssetManager.html" rel="nofollow">AssetManager</a>, but I've had trouble getting this to work, especially since you can't directly call <code>"res/raw"</code> as your filepath (or at least, it hasn't worked when I've tried. </p> <p>Suggestions? Thanks</p>
java android
[1, 4]
748,342
748,343
enable disable textbox inside a table when checkbox checked
<p>I am using jQuery. How to enable or disable textbox inside a table when checkbox checked. This is my edit.cshtml.</p> <pre><code> &lt;table id="scDetails" class="dataTable"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;RItem&lt;/th&gt; &lt;th&gt;IChecked&lt;/th&gt; &lt;th&gt;Notes&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; @foreach (var fback in Model.Fbacks) { &lt;tr&gt; &lt;td @Html.DisplayFor(m =&gt; fback.RItem)&lt;/td&gt; &lt;td&gt;@Html.CheckBoxFor(m =&gt; fback.IChecked)&lt;/td&gt; &lt;td&gt;@Html.TextBoxFor(m =&gt; fback.Notes)&lt;/td&gt; &lt;/tr&gt; } &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>What i have tried is:</p> <pre><code> $('td :checkbox').change(function () { var parentTx = $(this).closest('tr').find(input[type = "text"]); if (this.checked) { parentTx.attr("disabled",false); } else { parentTx.attr("disabled", true); } }); </code></pre> <p>Where am doing wrong? I dont want to use any classes on the controls to achieve this.</p>
javascript jquery
[3, 5]
5,764,638
5,764,639
jquery detecting and removing an element clicked
<p>I have a hierachy of DIVs with classes associated but not IDs. How can I remove the item being clicked?</p> <pre><code>&lt;div&gt; &lt;div class="minibox" onclick="remove_me()"&gt;Box1&lt;/div&gt; &lt;div class="minibox" onclick="remove_me()"&gt;Box1&lt;/div&gt; &lt;div class="minibox" onclick="remove_me()"&gt;Box1&lt;/div&gt; &lt;div class="minibox" onclick="remove_me()"&gt;Box1&lt;/div&gt; &lt;div class="minibox" onclick="remove_me()"&gt;Box1&lt;/div&gt; &lt;/div&gt; &lt;script&gt; function remove_me(){ ///remove the clicked div } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,859,950
2,859,951
How to set a var to true or false using .val()
<p>I have a textbox, I need to check if the textbox is empty and set a variable accordingly to true or false.</p> <p>my code at the moment print the value of the textbox.</p> <pre><code>var isDateTimEndEmpty = dateTimeEnd.val() == null ? true : false; </code></pre> <p>what am I doing wrong here?</p>
javascript jquery
[3, 5]
5,012,342
5,012,343
Replacing Link Button and label with check boxes
<p><a href="http://stackoverflow.com/questions/4263489/need-help-with-repeater">This</a> is my repeater in GUI and code behind ..I need to replace the 'Make Default' linkbutton with a Check Box now. What I want to do is that When user Checks the checbox, the Default value is set to TRUE in DB , Also when a check box is Checked, it will be grayed out..</p> <p>NOW :( I was just trying to implement this but there's no CommandName attribute for checkbox and not even CommandArgument attribute!!</p> <p>How do I change my code now ? :(</p> <p>All I wanna do is replace that Link Button with Checkbox. Somebody please help me out with this..How do i pass arguments to this check box ..I need the command arguments for my "SetDefault" method that sets the address to TRUE if Default is selected </p> <p><strong>[EDIT]</strong></p> <p>I am not getting it..in my Link Button now I am passing 2 command arguments like this <code>CommandArgument='&lt;%# Eval("UserID") + "," + Eval("IsB") %&gt;'</code> Now how do i pass these two Comand arguments that I need for my SetDEfault method in checkebox!? ok i got it that we use OnCheckChanged event when its check box and ItemCommand event is used when its link button...I am just not getting how will I pass these two command arguments in my checkbox</p> <p>[EDIT] <strong>Do I need to pass these two command arguments via text attribute ?</strong></p> <pre><code>&lt;asp:CheckBox Text='&lt;%# Eval("UserID") + "," + Eval("IsB") %&gt;' runat="Server"/&gt; </code></pre>
c# asp.net
[0, 9]
4,434,787
4,434,788
How to prepend number with zero
<p>I have the below script running and the following logcat report as at the moment it is not working. Could someone help me get this working and if possible also explain what I am doing wrong.</p> <pre><code> Calendar calendar = Calendar.getInstance(); sdf = new SimpleDateFormat("mm"); NValue = sdf.format(calendar.getTime()); NValue = String.format("%02d", NValue); </code></pre> <p>Logcat report:</p> <pre><code>05-10 14:02:52.281: E/AndroidRuntime(295): java.util.IllegalFormatConversionException: d is incompatible with java.lang.String </code></pre>
java android
[1, 4]
461,020
461,021
Postback Error?
<p>I wonder why if anyone has idea of this error? My ASP.Net page was working fine when publish on my Win7 IIS7 and on another Server 2008 IIS7, but today when I do the same one for another Server 2008, all the ajax postback gives this error:</p> <pre><code>#Exception Message: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.office_desktop_wlogin_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\paradigmasp\77933d43\29398497\App_Web_npn2130s.2.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) </code></pre> <p>I wonder what will be the possible reason for the error?</p> <p>Thanks in advance...</p>
c# asp.net
[0, 9]
2,254,979
2,254,980
Jquery submit form error
<p>I have a form which I want to submit upon button click which is outside the form, here is my HTML :</p> <pre><code>&lt;form id="checkin" name="checkin" id="checkin" action="#" method="post"&gt; &lt;input type="text" tabindex="100" class="identifier" name="identifier" id="identifier"&gt; &lt;input type="submit" tabindex="101" value="Submito" class="elsubmito" name="submit"&gt; &lt;/form&gt; </code></pre> <p>Here is my jQuery :</p> <pre><code>$("button").live('click', function() { $("#checkin").submit(); }); $("#checkin").live('submit', function() { }); </code></pre> <p>When I click submit button inside the form its submitting ok, but its not submitting when I click on the button which is outside the form tags, why? how can I fix this ?</p>
javascript jquery
[3, 5]
4,382,533
4,382,534
.html not working as intended
<pre><code>$('#clicker').click(function () { collegeArray = ["Harvard", "Yale", "Princeton"]; alert(collegeArray.length); for (var i = 0; i &lt; collegeArray.length; i++) { var divIdName = 'college' + i + 'Div'; //manuplating name of each div generated dynamically var newdiv = document.createElement('div') .setAttribute('id', divIdName) //setting the name of each div created dynamically .html('&lt;p&gt;' + collegeArray.toString() + '&lt;/p&gt;') appendTo($(#'survey')); } }); </code></pre> <p>The above code should append html everytime the clicker button is pressed, but it's not working. I'm not sure what I'm doing wrong here</p> <p><a href="http://jsfiddle.net/HvJnH/19/" rel="nofollow">http://jsfiddle.net/HvJnH/19/</a></p>
javascript jquery
[3, 5]
1,798,275
1,798,276
run jquery on php page open
<p>I have a jquery notification bar script that im using. I don't know the first thing about jquery and javascript, but anyway, heres the code:</p> <pre><code>&lt;script src="jquery.bar.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; $("#msgup").bar({ color : '#FFFFFF', background_color : '#8F0000', removebutton : false, message : 'hello', time : 4000 }); </code></pre> <p>how do i run this using php echo when the page opens? To run it with a link i use this</p> <pre><code>&lt;a id=bar&gt;click here&lt;/a&gt; </code></pre> <p>this code would run in a section of the page that refreshes every 10 sections using jquery, so yeah, must check on 'page load'</p>
php jquery
[2, 5]
4,569,136
4,569,137
response.end method causing session variable to expire
<p>I am storing the returned sql resultant rows in a session variable ... so that I need not to query again and again</p> <pre><code>Session["ds"] = datasetname; </code></pre> <p>Everything is fine but when I am doing export to excel ... where at last after the export is completed I am calling the method in try/catch</p> <pre><code>try { Response.End() } catch {} </code></pre> <p>But due to this, my session variable (ds) is getting expired and when I am using it next there is no rows and hence my page displays no data.</p> <p>I tried going through internet and found that this is a bug it seems as identified by Microsoft and they have provided a hotfix for this but in Windows Vista .... I am running on XP.</p> <p><a href="http://support.microsoft.com/kb/935778" rel="nofollow">http://support.microsoft.com/kb/935778</a></p> <p>Is there any other workaround to this problem? Please let me know.</p> <p>Thanks, Rahul </p>
c# asp.net
[0, 9]
3,872,238
3,872,239
Datepicker works in IE error in Firefox or Chrome
<p>Web form with date picker, one of the fields is cdate , I use jsdatepick for this field.</p> <pre><code>&lt;script type="text/javascript"&gt; window.onload = function(){ new JsDatePick({ useMode:2, target:"cdate", dateFormat:"%d-%M-%Y" }; &lt;/script&gt; &lt;form method="POST" action="insert_record.php"&gt; &lt;tr&gt; &lt;td style="width: 143px"&gt;Call Date: &lt;/td&gt; &lt;td style="width: 472px"&gt; &lt;input type=text id="cdate" name="cdate" size=40 style="color: black;background-color:#FFFF66; width: 270px;"&gt; &lt;/td&gt; </code></pre> <p>and the form submit php is </p> <pre><code>&lt;? $cdate=$_POST['cdate']; $db="call"; $link = mysql_connect("localhost", "sql", "sql"); //$link = mysql_connect("localhost",$_POST['username'],$_POST['password']); if (! $link) die("Couldn't connect to MySQL"); mysql_select_db($db , $link) or die("Select Error: ".mysql_error()); $result=mysql_query("INSERT INTO data (cdate) VALUES ('$cdate')")or die("Insert Error: ".mysql_error()); mysql_close($link); print "Record added\n"; ?&gt; </code></pre> <p>however once submitted I get message saying :: </p> <blockquote> <p>Notice: Undefined index: cdate in d:\web\apache\htdocs\callz\submit_record.php on line 4</p> </blockquote> <p>this message only occurs in Firefox or Chrome, works fine in any version of IE any ideas? Note there are other variables besides cdate, all of those variables enter into the table without issue, just seems to be the datepick one. I have tried another datepick and this doesn't happen, only with the jsdatepick, but jsdatepick is so much more suitable. Any ideas? thanks</p>
php javascript
[2, 3]
193,551
193,552
How to reload page every 5 second?
<p>Hi I am converting one layout to html , once I make the changes in code html/css then every time I have to hit F5. is there any simple javascript/ jQuery solution for this. </p> <p>like i add the script and its reload the whole page every 5(or specific time)</p> <p>thanks</p>
javascript jquery
[3, 5]
5,808,251
5,808,252
Mask input for time(`01:55`)
<p>I want mack a mask input for time(<code>01:55</code>) without use plugin,as only accept to user typed four number, (i mean, when user type number <code>01</code> put after it this <code>:</code> and next user type <code>55</code>), how is it?</p> <p>This is my code that not work:</p> <pre><code>&lt;input name="text" class="time"&gt; $('.time').live('keyup change',function(){ this.value = this.value.replace(^[0-1]?[0-9]{1}:[0-5]{1}[0-9]{1}, "") }); </code></pre> <p>Here is full code: <a href="http://jsfiddle.net/yGLsH/" rel="nofollow">http://jsfiddle.net/yGLsH/</a></p>
javascript jquery
[3, 5]
2,941,376
2,941,377
jQuery - get the selected options of a listitem collection?
<p>I have fields that a user would enter and i would pass it into jQuery and pass to a web service. </p> <p>I can get textboxes values by:</p> <p>var name = $("#MainContent_txtName").val() </p> <p>The problem I'm having is a multi-select that comprises of a list item collection. If I was to do this server side, I would do something like:</p> <pre><code>foreach (ListItem li in listTitles) { if (li.Selected) { selectedValue += li.Value + ","; } } </code></pre> <p>And this would give me the string of selected values from the select list. I'm having trouble getting it out from jQuery. If I do </p> <pre><code>var titles = $("#MainContent_selectListTitles").val() </code></pre> <p>That is obviously incorrect because it won't bring back the selected list items. I saw a post that suggested that I could retrieve it if I say option selected. So I tried this:</p> <pre><code>var titles= $('#MainContent_selectListTitles option:selected'); </code></pre> <p>The next thing I did was pop an alert to see what the titles were. It just said [object, object]. </p> <p>So my questions are:</p> <ol> <li><p>Is it possible to get the selected items from the list item collection concatenated into a string? </p></li> <li><p>Or is it better that I get all the form values from a postback even on my code behind and then call the jquery function? If this is an option, i've attempted to do this but have failed. It tells me that it can't find the method. So i'm definitely not calling the jquery function correctly on postback of the button event.</p></li> </ol> <p>THanks.</p>
javascript jquery asp.net
[3, 5, 9]
3,815,163
3,815,164
How to make our app resolution free
<p>We have to display many TextView on canvas with proportion to screen resolution.How we can define the textSize and any ImageView size corresponding to Screen resolution so that they can display ratio wise.</p>
java android
[1, 4]
3,088,871
3,088,872
jquery detect coordinate of top of page after scrolling
<p>I have a 'back button' that I would like to stick to the header until you scroll past a certain point (so I have it absolutely positioned but would like it positioned 'fixed' when you scroll past the header).</p> <p>Kinda like the 'GAMEHQ' section does here: <a href="http://scores.espn.go.com/mlb/preview?gameId=311027124" rel="nofollow">http://scores.espn.go.com/mlb/preview?gameId=311027124</a></p> <p>Any suggestions? Thanks!</p>
javascript jquery
[3, 5]
2,323,301
2,323,302
Busy spinner while retrieving data
<p>I would like to add a busy spinner while retrieving data from a Mysql database. The code is written in PHP. The problem is that it takes too long time to get back the result from Mysql database and I would like that the user get some indication that something is happening.</p> <p>Is there a way to do that?</p> <p>The code looks like this:</p> <pre><code>&lt;?php include "db.php" ?&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Test&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php // This part takes too long time to execute $query = "SELECT * FROM bokings WHERE Bokningsnr = '83270'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)){ $showid = $row['showid']; echo $showid."&lt;br&gt;"; } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Regards.</p> <p>/Oualid</p>
php jquery
[2, 5]
2,755,467
2,755,468
Passing array values from php to javascript data returns only one value
<p>This function works fine, but it only returns one value. What I'm missing here?</p> <p>Here's my code:</p> <pre><code> &lt;script type='text/javascript'&gt; $(function () { &lt;?php //Get the names and id's $get_info=mysql_query("select * from table where id = '1'"); if($get_info){ while($row_info=mysql_fetch_array($get_info)) { $username=$row_info['name']; $user_id=$row_info['profile_id']; ?&gt; onDataRequest:function (mode, query, callback) { var data = [ { id:&lt;?php echo $user_id;?&gt;, name:'&lt;?php echo $username;?&gt;', 'avatar':'http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif', 'type':'contact' } ]; data = _.filter(data, function(item) { return item.name.toLowerCase().indexOf(query.toLowerCase()) &gt; -1 }); callback.call(this, data); } }); &lt;?php }} ?&gt; }); &lt;/script&gt; </code></pre> <p><strong>Expected result:</strong></p> <pre><code>{ id: 295, name: 'Mike', 'avatar': 'http: //cdn0.4dots.com/i/customavatars/avatar7112_1.gif', 'type': 'contact' }, { id: 296, name: 'John', 'avatar': 'http: //cdn0.4dots.com/i/customavatars/avatar7112_1.gif', 'type': 'contact' } </code></pre> <p><strong>Actual output:</strong></p> <pre><code>{ id: 295, name: 'Mike', 'avatar': 'http: //cdn0.4dots.com/i/customavatars/avatar7112_1.gif', 'type': 'contact' } </code></pre> <p>It just returns 1 item.</p>
php javascript
[2, 3]
4,906,904
4,906,905
display partial data as and when got
<p>I use jquery and php for my website. I am facing a problem. After page load, i send all the data after formatting to client and display it using jquery. mine is a products website. So i display 10 products per page. so displaying 10 products per page. Is there a way to send partial data to client and display it as and when its got?</p>
php jquery
[2, 5]
1,209,362
1,209,363
Make the scrollbar fixed to bottom even while appending content to it
<p>For better understanding I am trying to implement chatbox with smooth transition of previous (upper) chat messages.</p> <p>Here is the <a href="http://jsfiddle.net/eEEGE/" rel="nofollow">http://jsfiddle.net/eEEGE/</a></p> <p>When I click "Add" I want all the number 1 - 9 slide up and append 10-12 below it.</p> <p>Or in other word I want the scrollbar always scrolled fix at bottom.</p> <p>I know that I can reposition the scrollbar after appending but then I will not able to see sliding animation.</p> <p>Code Reference</p> <pre><code>$(document).ready(function(){ // set the default scroll bar to bottom of chat box $(".chat-list").scrollTop($(".chat-list")[0].scrollHeight); $("button").click(function(){ $('.chat-list li:last-child').append('10&lt;br/&gt;11&lt;br/&gt;12'); $('.chat-list li:last-child').show('slow'); }); }); &lt;ul class="chat-list"&gt; &lt;li&gt;1&lt;/li&gt; &lt;li&gt;2&lt;/li&gt; &lt;li&gt;3&lt;/li&gt; &lt;li&gt;4&lt;/li&gt; &lt;li&gt;5&lt;/li&gt; &lt;li&gt;6&lt;/li&gt; &lt;li&gt;7&lt;/li&gt; &lt;li&gt;8&lt;/li&gt; &lt;li&gt;9&lt;/li&gt; &lt;li style="display:none"&gt;&lt;/li&gt; &lt;/ul&gt; &lt;button&gt;add&lt;/button&gt; .chat-list{ height:100px; overflow:auto; } </code></pre>
javascript jquery
[3, 5]
2,446,046
2,446,047
How can I have a button be disabled with jQuery but also run server code once it's been clicked?
<p>I have a button that will execute a stored procedure. After it's been clicked, I want it disabled so that the user can't click it multiple times. However, once it's been clicked, I also want to run some C# on the server side through an <code>onclick</code> event. As of right now, all my code does is disable the button, but then it won't run the server side stuff. Can this be achieved? Here's my jQuery:</p> <pre><code> $("#btnGenerate").click(function () { $(this).attr("disabled", true).val("Generating..."); }); </code></pre>
c# jquery asp.net
[0, 5, 9]
2,690,725
2,690,726
JQuery Datepicker issue - asp.net
<p>I have used JQuery within my asp.net page. JQuery is working fine. I could see the calendar and can pickup the date. The problem is that when the page is postbacked the value is lost. Am i missing some code? Does anyone of you have the idea?</p> <p>Below is what i have done -</p> <p>1) Included the files - </p> <pre><code>&lt;script src="../scripts/date.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="../scripts/jquery.datePicker.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href="../css/DatePicker.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="../css/DateCalendar.css" rel="stylesheet" type="text/css" /&gt; </code></pre> <p>2) Linked with the textboxes -</p> <pre><code>jQuery(function($){ Date.format = 'mm/dd/yyyy'; $("#&lt;%=txtAssignDate.ClientID%&gt;").datePicker({startDate:'01/01/1996'}); $("#&lt;%=txtCloseFileDate.ClientID%&gt;").datePicker({startDate:'01/01/1996'}); $("#&lt;%=txtInspectionDt.ClientID%&gt;").datePicker({startDate:'01/01/1996'}); }); </code></pre>
asp.net jquery
[9, 5]
1,072,801
1,072,802
Update existing notification
<p>Now that the <a href="http://developer.android.com/reference/android/app/Notification.html#describeContents%28%29" rel="nofollow"><code>setLatestEventInfo</code></a> method is deprecated in the latest Android SDK, is there a way that we're supposed to update the content of an existing notification? I am skeptical that they expect us to create a new notification every time we want to update the notification content.</p> <p>The <a href="http://developer.android.com/guide/topics/ui/notifiers/notifications.html" rel="nofollow">Notification Guide</a> doesn't appear to have been updated to make use of the suggested <a href="http://developer.android.com/reference/android/app/Notification.Builder.html" rel="nofollow"><code>Notification.Builder</code></a> class either.</p>
java android
[1, 4]
1,975,145
1,975,146
How can I validate an ANDROID_ID in php?
<p>How can I validate an id that is retrieved via Secure.ANDROID_ID in php?</p> <p>I'm writing the server side of an app that uses them but want to make sure that requests that include invalid/fake Android IDs don't get responses.</p>
php android
[2, 4]
4,724,633
4,724,634
Preventing JavaScript code from running by removing from the page source at runtime
<p>Somebody entered XSS code in my friend's site. It inserts <code>&lt;script&gt;alert(0)&lt;/script&gt;</code> in the page source. You can see it <a href="http://technoflexusdatastreamapi.appspot.com/listData" rel="nofollow">here</a>.</p> <p>Is there a way to remove this from the page at runtime, to prevent it from being executed?</p> <p>He has a presentation on it tomorrow and he has no access to database to remove it.</p>
javascript jquery
[3, 5]
1,194,763
1,194,764
Get String From CodeBehind
<p>What is the difference between <code>&lt;%#...%&gt; and &lt;%=...%&gt;</code> ? For example I wanted to take the username of the logged in user and I tried with <code>"&lt;%# Membership.GetUser().UserName %&gt;"</code> but this didn't work. Then I tried with <code>&lt;%= Membership.GetUser().UserName %&gt;</code> and with this works. Why with the first try (<code>"&lt;%# Membership.GetUser().UserName %&gt;"</code>) didn't work but the second works fine (<code>&lt;%= Membership.GetUser().UserName %&gt;</code>) ?</p> <p>With this code didn't work I can't get the field from "<code>Membership.GetUser().UserName</code>":</p> <pre><code>&lt;div id="profileHeader"&gt; &lt;h1&gt;&lt;%# Membership.GetUser().UserName %&gt;&lt;/h1&gt; &lt;/div&gt; </code></pre> <p>With this code work I can get the field from "<code>Membership.GetUser().UserName</code>":</p> <pre><code>&lt;div id="profileHeader"&gt; &lt;h1&gt;&lt;%= Membership.GetUser().UserName %&gt;&lt;/h1&gt; &lt;/div&gt; </code></pre>
c# asp.net
[0, 9]
4,850,851
4,850,852
Java or C++ to learn as a first prgramming language
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/345907/should-freshers-learn-java-or-c">Should freshers learn Java or C++?</a> </p> </blockquote> <p>I am a high schooler and am unsure whether to learn Java or C++. I would like to major in aerospace engineer so i want to learn the language that is the most useful in that field. If you guys have a better language that i should learn besides these two, recommend it. I will in my future learn both but for now i want to just learn one and get comfortable with it as i do not have any rush to learn the languages. Also if you guys have any books, or online places where i can learn this on my own, tell me.</p>
java c++
[1, 6]
854,267
854,268
How to get the object reference inside a JQuery callback function?
<p>Let's say that we have a javascript object called aObject and the test() function is used as a callback function in JQuery</p> <pre><code>var aObject = { aVariable : 'whatever value', test : function() { // Trying to access property. But doesn't work as expected since I am getting the DOM element, not the aObject reference var temp = this.aVariable; } } var anInstanceOfAObject = $.extend({}, aObject); anInstanceOfAObject.someFunction = function () { // I have to put "this" in a variable since "this" in the context below refers to the DOM element, not the instance of the object var placeHolder = this; $('some random div.element').theJavascriptFunction({ "theJavascriptCallbackFunction": placeHolder.test, }); } </code></pre> <p>Inside that test() function, normally the context of "this" is the DOM element. My question is how to reference aObject since we can't use "this" to reference it.</p> <p>EDIT: I am not sure if the syntax above is the correct/preferred way to instantiate an Object. I see some examples using this syntax</p> <pre><code>var aObject = function() {.... </code></pre> <p>Please inform me if this seems to be relevant to the problem.</p>
javascript jquery
[3, 5]
1,941,116
1,941,117
Can i access internal memory of Application of A using another apllication B?
<p>I have two applications.</p> <p>Application - A and Application - B</p> <p>Application - A download songs from the server and stored into the internal memory . I want to read those download files using Application - B.</p> <p>Is it possible ? If yes then how can i do this ?</p> <p>Thanks In Advace.</p>
java android
[1, 4]
1,133,341
1,133,342
What is the best way to interface C# and Java?
<p>Hypothetically, you have two products, one written in Java, the other in C#. You like the Java based backend (non-user visible portion), but would like to use the C# (WPF) frontend. What is the best way to go about interfacing them? </p> <p>Note that the backend must be able to run on either a server or on the local machine and the frontend should be able to connect to either one.</p> <p>My first thoughts were to use something like <a href="http://www.zeroc.com" rel="nofollow">Ice</a>, or maybe a webservice.</p> <p>And Go!</p> <p><strong>Edit</strong></p> <p>Converting the code or running it in some variety of neutral VM (IKVM) is not an option.</p>
c# java
[0, 1]
683,390
683,391
asp .net jquery
<p>I am new to asp .net. I am trying to use the JQuery library scripts. So included them in my aspx page as follows</p> <pre><code>&lt;script src="&lt;%= Page.ResolveClientUrl("~/jquery-1.3.2.js")%&gt;" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="&lt;%= Page.ResolveClientUrl("~/jquery.validate.js")%&gt;" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="&lt;%= Page.ResolveClientUrl("~/jquery.form.js")%&gt;" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>I just wrote the sample code to test the alert message.</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; $(document).ready(function() { alert('hi'); }); &lt;/script&gt; </code></pre> <p>I did not get any error when the page loaded but the alert message is not displayed. I hope I have got all the files necessary for using jquery. But I dont know why the alert message does not display. Any thoughts or comments?</p>
asp.net jquery
[9, 5]
1,668,593
1,668,594
Jquery Counter from 0% to 100% with step function
<p>i have 2 divs, the blue one is set to 365px width (this will actually be the page height so i cant pre determine it)</p> <p>then the grey one i need to count from 0 - 100%</p> <p>at the moment it counts from 365 to 0</p> <p><a href="http://jsfiddle.net/Bill/BNVyq/" rel="nofollow">http://jsfiddle.net/Bill/BNVyq/</a></p>
javascript jquery
[3, 5]
2,314,640
2,314,641
Is jquery interface.js com always working with the new version of jQuery?
<p>On the interface.js website (<a href="http://interface.eyecon.ro/" rel="nofollow">http://interface.eyecon.ro/</a>) they propose to download interface.js with jquery 1.1.2. I would like to know if interface.js is still compliant with the new version of jquery and if there will be new release of this library.</p> <p>I had some trouble to use jquery 1.2.x with interface 1.2, and using jquery 1.1.4 correct bugs I had.</p> <p>Sorry for my bad english, hope someone understand my question ^^ </p>
javascript jquery
[3, 5]
3,664,505
3,664,506
Learn Java from Python background
<p>I have been programming in Python for a while now, and I'd like to learn a more "hireable" language like Java or the C/C++/C# family. I'm acquainted with (though not necessarily good at) all of them. I'm leaning towards Java because it runs just about everywhere, and I'd like to start developing for the Android. </p> <p>Coming from a dynamic language, what is the best way for me to learn Java? Or should I learn a C based language instead?</p>
java python
[1, 7]
5,404,396
5,404,397
How to remove the duplicated part of string by comparing two string in Jquery or Javascript
<pre><code>$str1='&lt;option value="AAA"&gt;AAA&lt;/option&gt;&lt;option value="BBB"&gt;BBB&lt;/option&gt;&lt;option value="CCC"&gt;CCC&lt;/option&gt;'; $str2='&lt;option value="CCC"&gt;CCC&lt;/option&gt;&lt;option value="DDD"&gt;DDD&lt;/option&gt;'; </code></pre> <p>I would like the expected result as following. If some part of <code>$str2</code> which is duplicated with part of <code>$str1</code>, then removing the duplicated part of $str2.</p> <p>Expected result:</p> <pre><code>$expectedStr = '&lt;option value="DDD"&gt;DDD&lt;/option&gt;'; </code></pre> <p>Can anyone help me?</p>
javascript jquery
[3, 5]
2,810,383
2,810,384
How to perform action when a click happens outside of specified elements
<p>I am trying to set up a system so that when a user clicks, if that click did not originate from within a specified div then a function should be fired that will do something with that div. Basically more when a user clicks outside of a div i want to hide it, but the problem is that i have a few elements that i want to do this with, so event.stopPropagation doesn't work very well.</p> <pre><code>document.onclick = function (e) { e = !e ? window.event.srcElement : e.target; if ($('#toppanel div#panel').not(e.id).is(':visible')) { $('.dashboardNav .addWidget').click(); } if ($('#TrackRibbon').not(e.id).is(':visible')) { $('.dashboardNav #openRibbon').click(); } if ($('.subnav').not(e.id).is(':visible')) { $('.subnav').hide(); } } </code></pre> <p>but this doesn't work as i want either yet, it does somewhat, but i have multiple .subnav on the page and with this you can open all of them without the others closing.</p> <p>any ideas on how to accomplish a goal like this would be greatly appreciated, also if i didnt explain well enough just let me know.</p>
javascript jquery
[3, 5]
5,392,051
5,392,052
jQuery .each being applied to broadly
<p>I have a small script which makes an <code>li</code> element click-able and sets the location to that of a link inside of the <code>li</code>. This runs without error and my two <code>console.log()</code> calls are reporting back what I would expect, however, when you click on the <code>li</code> (whichever <code>li</code>) you are taken the <code>href</code> of the link in the last <code>li</code>. This doesn't make much sense to me as I thought I had properly handled the scope. </p> <p>Please correct my understanding and let me know where I went wrong. </p> <p>JavaScript: </p> <pre><code>$(".homeCTA li").each(function(){ $href = $(this).find("a").attr("href"); console.log($(this)); // displays the expected selector console.log($href); // displays the correct href $(this).click(function(){ window.location = $href }); // this is overriding all of the previous passes }); </code></pre> <p>HTML:</p> <pre><code>&lt;ul class="homeCTA"&gt; &lt;li class="left"&gt; &lt;img src="first-source.jpg"&gt; &lt;h2&gt;&lt;a href="SearchResults.asp?Cat=1833"&gt;Yada Yada Yada&lt;/a&gt;&lt;/h2&gt; &lt;/li&gt; &lt;li class="right"&gt; &lt;img src="second-source.jpg"&gt; &lt;h2&gt;&lt;a href="SearchResults.asp?Cat=1832"&gt;Try the bisque&lt;/a&gt;&lt;/h2&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre>
javascript jquery
[3, 5]
5,718,824
5,718,825
Using C#/VB.NET values in Javascript
<p>I have searched for a definitive answer to my question and not been able to find one. Lots a site cover the topic but I cannot find the answer I am looking for.</p> <p>I have an ASPX page that, for example, processes customer queries. In the code behind I have a Customer class. If I want to use, for example, the customer ID and Name in a JavaScript function. What is the best way for me to do it?</p> <p>I have this code (a website I have been asked to update) but I try to sort out all warnings VS displays and this code displays two.</p> <pre><code>&lt;script type="text/javascript"&gt; function DoSomeThingFunction(enable) { var enableStr = enable ? "on" : "off"; var intClientID = &lt;%= Customer.ClientID %&gt;; var strClientName = &lt;%= Customer.ClientName %&gt;; &lt;!-- More functionality --&gt; }; &lt;/script&gt; </code></pre> <p>Expected expression on the following two lines..</p> <pre><code>var intClientID = &lt;%= Customer.ClientID %&gt;; var strClientName = &lt;%= Customer.ClientName %&gt;; </code></pre> <p>I can update this code to stop the warnings..</p> <pre><code>&lt;script type="text/javascript"&gt; function DoSomeThingFunction(enable) { var enableStr = enable ? "on" : "off"; var intClientID = parseInt('&lt;%= Customer.ClientID %&gt;'); var strClientName = '&lt;%= Customer.ClientName %&gt;'; &lt;!-- More functionality --&gt; }; &lt;/script&gt; </code></pre> <p>My question is: What is the best method of achieving this without getting any kind of warning? Does the best method mean I will get a warning and therefore have to put up with it? I hate to see warnings of any kind and try to fix them all.</p> <p>Thanks for looking</p>
c# javascript asp.net
[0, 3, 9]
4,460,494
4,460,495
JQuery over JavaScript Why and When to use?
<p>I'm a student and also new to JQuery. I want to know the difference between JQuery vs JScript. How we decide what to use and when to use those two technology.</p> <p>Considering </p> <ol> <li>Performance</li> <li>Technology</li> </ol>
javascript jquery
[3, 5]
2,598,736
2,598,737
How to keep spaces in the formatted expression in jqMath
<p>I am using <a href="http://mathscribe.com/author/jqmath.html" rel="nofollow">jqMath</a> for Math equation formatter. I don't want to remove spaces and newline character from the expression. How can I do that? I have tried a lot but I coudn't find any solution. </p>
javascript jquery
[3, 5]
460,663
460,664
jQuery .hide() not working
<p>I wrote a simple jQuery script and the .hide() is not properly rendering. You can see it <a href="http://jsfiddle.net/VBhYT/2/" rel="nofollow">here</a> on jsfiddle.</p>
javascript jquery
[3, 5]
1,316,703
1,316,704
Is JavaScript allowed to call a remote web page during a click event?
<p>When viewing the click in firebug, the call turns red (i.e. error) but I can't see the error because the page redirects.</p> <p><strong>So is it allowed to call a remote website (in my case, its a 1x1 image using a standard url like <a href="http://www.example.com/becon" rel="nofollow">http://www.example.com/becon</a>).</strong></p>
asp.net javascript jquery
[9, 3, 5]
5,663,407
5,663,408
ASP.NET button-click, using jQuery on a server control
<p>When you attach a client-side click event via jQuery to an ASP.NET button do you then lose the ability to do a postback? I merely need to do some jQuery prior to the server-side stuff happening and it seems to be interrupting this process. </p> <pre><code> $('[id$="btnDisableAlarms"]').click(function () { var commentValue = $('[id$="txtComment"]').val(); if (commentValue == "") { // add red border (CSS) $('[id$="txtComment"]').addClass("redCommentError"); } return; }); </code></pre> <p>The button is wired up with a click event but the browser doesn't budge.</p> <pre><code> btnDisableAlarms.Click+=new EventHandler(btnDisableAlarms_Click); public void btnDisableAlarms_Click(object sender, EventArgs e) { Response.Write("Still able to manage a postback from server"); } </code></pre>
jquery asp.net
[5, 9]
305,635
305,636
restrict space key value to transfer when no other character value is entered
<p>In my Chat application project, I am trying to restrict spaces when the user has just pressed <kbd>Space</kbd> and then <kbd>Enter</kbd>. pressing <kbd>Enter</kbd> will show entered Text into a <code>div</code>. Please see the comments in the code to understand clearly.</p> <pre><code>#txtmsg --&gt; ID of TextBox field </code></pre> <hr> <pre><code>$('#txtmsg').keypress(function (e) { if (e.which == 13) { //Disable default function of Enter key e.preventDefault(); //Checks whether the user has entered any value or not if ($('#txtmsg').val().length &gt; 0) { //if(user has not entered only spaces....)? //transfers the entered value in the text field to div chat.server.send($('#txtmsg').val()); $('#txtmsg').val(''); } } }); </code></pre>
javascript jquery asp.net
[3, 5, 9]
4,034,190
4,034,191
How to alert when new message comes in
<p>I've got an online chat room program written in PHP + MySQL + Javascript</p> <p>I use <code>jQuery.post()</code> to get new chat message from <code>chat.php</code>. This php program reads data from MySQL and <code>echo</code>s it on the page.</p> <p>How do I alert the user when new message comes in? I only want it to alert when the chat room page isn't focused.</p> <p>By the way, is flashing the webpage title a good idea to alert the user?</p>
php javascript
[2, 3]
5,415,385
5,415,386
How to add z-index via object?
<p>Is it possible add <code>z-index</code> via <a href="http://api.jquery.com/css/" rel="nofollow">css</a> method thought object:</p> <pre><code>jQuery('&lt;div/&gt;').css({ z-index: 1000, opacity: 0.7, width: jQuery(window).width(), height: jQuery(document).height(), top:0, left:0, position: 'absolute'}).appendTo('body'); </code></pre>
javascript jquery
[3, 5]
5,632,948
5,632,949
send email from several textboxs in asp
<p>at the moment i'm using a string[] to get all the emails from textboxs, and the sending them one at time.</p> <p>someone have a better idea for getting the the text and sending it ? </p>
c# asp.net
[0, 9]
1,004,197
1,004,198
How can I replace one DOM element with an array of jQuery objects?
<p>I have an array of jQuery objects that I built and which have events attached to them.</p> <pre><code>var obs = []; for(var i=0;i&lt;100;i++) { var j = jQuery('&lt;div&gt;&lt;/div&gt;'); j.click(function() { console.log('Clicked ' + i); }); obs.push(j); } </code></pre> <p>My HTML is:</p> <pre><code>&lt;div id="replaceme"&gt;&lt;/div&gt; </code></pre> <p>How do I replace the div on the page with all the jQuery objects in my array? I don't want to concatenate their HTML because I want to preserve the event handlers.</p>
javascript jquery
[3, 5]
300,887
300,888
jquery timeout function not working properly
<p>I am using the <code>setTimeout</code> function to set <code>display: block;</code> and append to <code>li</code>, on mouseover. I just want to remove the block and make it none.</p> <p>My function works fine but the problem is if the mouse crosses the <code>li</code>, it self the block getting visible. How can I avoid this?</p> <p>my code is: </p> <pre><code>var thisLi; var storedTimeoutID; $("ul.redwood-user li,ul.user-list li").live("mouseover", function(){ thisLi = $(this); var needShow = thisLi.children('a.copier-link'); if($(needShow).is(':hidden')){ storedTimeoutID = setTimeout(function(){ $(thisLi).children('a.copier-link').appendTo(thisLi).show(); },3000); } else { storedTimeoutID = setTimeout(function(){ $(thisLi).siblings().children('a.copier-link').appendTo(thisLi).show(); },3000); } }); $("ul.redwood-user li,ul.user-list li").live("mouseleave", function(){ clearTimeout(storedTimeoutID); //$('ul.redwood-user li').children('a.copier-link').hide(); $('ul.user-list li').children('a.copier-link').hide(); }); </code></pre>
javascript jquery
[3, 5]
5,520,160
5,520,161
Adding some custom session variables to a JavaScript object
<p>I currently have a custom session handler class which simply builds on php's session functionality (and ties in some mySQL tables).</p> <p>I have a wide variety of session variables that best suits my application (primarily kept on the server side). Although I am also using jQuery to improve the usability of the front-end, and I was wondering if feeding some of the session variables (some basics and some browse preference id's) to a JS object would be a bad way to go.</p> <p>Currently if I need to access any of this information at the front-end I do a ajax request to a php page specifically written to provide the appropriate response, although I am unsure if this is the best practice (actually I'm pretty sure this just creates a excess number of Ajax requests).</p> <p>Has anyone got any comments on this? Would this be the best way to have this sort of information available to the client side?</p>
php jquery
[2, 5]
361,345
361,346
Why doesn't this click handler work in JQuery?
<p>I've got the following code in my page:</p> <pre><code>var offer_link = $('&lt;a&gt;').addClass('fc-offer-link'); offer_link.click(function() { alert('Hello'); }); offer_link.attr('href', "#" + this.id); offer_link.append(this.subject); this.list_item = $('&lt;li&gt;'); this.list_item.append(offer_link); </code></pre> <p>But even though the link appears on the page, the handler never gets called. What's going on?</p>
javascript jquery
[3, 5]
4,025,254
4,025,255
Specifying relative file location in web.config for use by standard C# class library
<p>I'm struggling to find a way of specifying a file location in <code>web.config</code> appSettings that avoids using hard-coded paths but allows a non-'web aware' C# library to find a file.</p> <p>The C# library uses standard <code>File.Open</code>, <code>File.Exists</code> methods, etc. to operate on a data file, which is stored in my web application (ASP.NET MVC) tree, e.g. under:</p> <pre><code>\content\data\MyDataFile.txt </code></pre> <p>Requirements:</p> <ul> <li>I want to be able to specify my path like, e.g.:</li> </ul> <pre> &lt;appSettings> this--> &lt;add key="MyFileLocation" value="~\content\data\MyDataFile.txt" /> not --> &lt;add key="MyFileLocation" value="c:\inetpub\wwwroot\foo\content\data\MyDataFile.txt" /> &lt;/appSettings> </pre> <ul> <li>I don't want the C# library to be aware of the web application it's being used in, as it is used in other software, and the web application has no need to know about the configuration of the C# library so I don't really want to pass config info between the layers if possible.</li> </ul> <p>Any suggestions on how I can do this cleanly? Thanks!</p>
c# asp.net
[0, 9]
4,362,763
4,362,764
How to nest one ListView inside another ListView control in c# (Asp.net)?
<p>How to nest one <strong>ListView</strong> inside another <strong>ListView</strong> control in c# (Asp.net)??</p>
c# asp.net
[0, 9]
4,783,526
4,783,527
Java - Android Programming - Loop Fail
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/10492182/java-android-programming-loop-fail">Java / Android Programming - Loop FAIL</a> </p> </blockquote> <p>What i am trying to do: To throw a toast once an hour. What's the problem: The while loop has the appropriate interval only the first time it's executed. The second time no interval between the toasts is added. Note that the code included inside the while loop is debugging and working perfectly. The only problem is the delay between the toasts.</p> <pre><code> if (SelectedOption == 1) { int count = 1; while (count &lt;= 10) { final Handler handler = new Handler(); Timer t = new Timer(); t.schedule(new TimerTask() { public void run() { handler.post(new Runnable() { public void run() { db.open(); String fact = ""; fact = db.getRandomEntry(); Context context = getApplicationContext(); CharSequence text = fact; int duration = Toast.LENGTH_LONG; Toast toast = Toast.makeText(context, text, duration); toast.show(); db.close(); } }); } }, 3600000); count++; } } else if (SelectedOption == 2) { ... // Something similar using different approach } </code></pre>
java android
[1, 4]
2,325,303
2,325,304
Form Submit not working on window.onbeforeunload
<p>Desperate to submit the form when the user navigates away using the links on the page. Clicking the link sets the saveOnUnload to true, the Save() functions is entered, alert happens, but neither form.Submit nor btnObj.click() actually work, i.e. the form submit is skipped!</p> <pre><code>&lt;script language='javascript' type='text/javascript'&gt; function Save() { GetInputControl('hdnTimeOut').value = '2'; var btnObj = GetInputControl("btnSave"); alert (btnObj ); btnObj.click(); // document.aspnetForm.submit(); } window.onbeforeunload = function (e) { if (saveOnUnload) Save(); }; &lt;/script&gt; </code></pre>
c# javascript
[0, 3]
1,442,680
1,442,681
Select selected combobox with jQuery
<p>I've these three selects:</p> <pre><code>&lt;div id ="Xcombos" class = "styled-select"&gt; &lt;select id="combopie" class="Xcombo" style="display:none;"&gt; &lt;option value="gender"&gt;Gender&lt;/option&gt; &lt;option value="age"&gt;Age&lt;/option&gt; &lt;/select&gt; &lt;select id="combobar" class="Xcombo" style="display:none;"&gt; &lt;option value="date"&gt;Date&lt;/option&gt; &lt;option value="age"&gt;Age&lt;/option&gt; &lt;/select&gt; &lt;select id="comboline" class="Xcombo" style="display:none;"&gt; &lt;option value="date"&gt;Date&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; </code></pre> <p>The user should select only one of this 5 <code>options values</code> (gender, age, date, age, date)</p> <p>I was using this:</p> <pre><code>var Xcombo_values = $('#Xcombos .Xcombo').val() </code></pre> <p>But this only gives me values of the first <code>select</code>.</p> <p>How Can I grab the value of selected option ?</p> <p>Cheers</p> <p><strong>Update :</strong></p> <p>radio:</p> <pre><code>&lt;input type="radio" name="tipo" id="pie" value="pie" /&gt;&lt;label for="pie"&gt; &lt;input type="radio" name="tipo" id="bar" value="bar" /&gt;&lt;label for="bar"&gt; &lt;input type="radio" name="tipo" id="line" value="line" /&gt;&lt;label for="line"&gt; $(function () { $('input[type=\'radio\']').click(function () { $('select.Xcombo').hide(); $('#combo' + $(this).attr('id')).show(); }); }); </code></pre>
javascript jquery
[3, 5]
1,148,897
1,148,898
Can't add duplicate row to the asp.net Table Control
<p>I have an asp.net table control like this:</p> <pre><code> TableHeader A Text | Textbox </code></pre> <p>What I want to do is, in the page_load event, duplicate second row with all the controls within it, change the text in the first cell and add as a new row. So here is my code:</p> <pre><code> for (int i = 0; i &lt; loop1counter; i++) { TableRow row = new TableRow(); row = myTable.Rows[1]; //Duplicate original row char c = (char)(66 + i); if (c != 'M') { row.Cells[0].Text = c.ToString(); myTable.Rows.Add(row); } } </code></pre> <p>But when I execute this code it justs overwrites on the original row and row count of the table doesn't change. Thanks for help....</p>
c# asp.net
[0, 9]
3,883,731
3,883,732
how to get the short codes?
<p>how to get the short codes from a service providers? I want to create a app that could receve these sms sent to the short codes by the user and the app should return the response to the client. </p>
java android
[1, 4]
950,311
950,312
How to set a dropdownlist item as selected in ASP.NET?
<p>I want to set selecteditem for asp. net dropdownlist control programmatically.</p> <p>So I want to pass a value to the dropdownlist control to set the selected item where is the value of the item equal to the passed value.</p>
c# asp.net
[0, 9]
2,839,578
2,839,579
Receive image from c# in php
<p>I use this code to send an image from desktop application to a php file on server:</p> <pre><code>// Create a request using a URL that can receive a post. WebRequest request = WebRequest.Create("http://example.com/img.php"); // Set the Method property of the request to POST. request.Method = "POST"; // Create POST data and convert it to a byte array. string postData = "hello"; byte[] byteArray = ImageToByte(image);//Encoding.UTF8.GetBytes (postData); byteArray = Encoding.UTF8.GetBytes(postData); // Set the ContentType property of the WebRequest. request.ContentType = "application/x-www-form-urlencoded"; // Set the ContentLength property of the WebRequest. request.ContentLength = byteArray.Length; // Get the request stream. Stream dataStream = request.GetRequestStream (); // Write the data to the request stream. dataStream.Write (byteArray, 0, byteArray.Length); // Close the Stream object. dataStream.Close (); // Get the response. WebResponse response = request.GetResponse (); // Display the status. Console.WriteLine (((HttpWebResponse)response).StatusDescription); // Get the stream containing content returned by the server. dataStream = response.GetResponseStream (); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader (dataStream); // Read the content. string responseFromServer = reader.ReadToEnd (); // Display the content. Console.WriteLine (responseFromServer); // Clean up the streams. reader.Close (); dataStream.Close (); response.Close (); </code></pre> <p>What function should I use in php to receive the image file?</p>
c# php
[0, 2]
1,765,527
1,765,528
How to encode a URL string
<p>I have a string that contains a url which looks like this:</p> <p><a href="http://www.test.com/images/tony" rel="nofollow">http://www.test.com/images/tony</a>'s pics.jpg</p> <p>I need the url to look like this:</p> <p><a href="http://www.test.com/images/tony%27s%20pics.jpg" rel="nofollow">http://www.test.com/images/tony%27s%20pics.jpg</a></p> <p>How would I programmatically solve this with a url in a STRING form. Thanks.</p>
c# asp.net
[0, 9]
4,556,123
4,556,124
Android display an image based on a calculation
<p>I have an EditText box where the user inputs a number and 3 TextViews that display the result of some calculations. Instead of showing "2" as the result, I would like to show a specific picture based on the result. i.e. "1"=pic1 "2"=pic2.... </p>
java android
[1, 4]
3,997,292
3,997,293
Preventing OnClientClick to newtab of Button to trigger Other clicks on the page
<p>I am using a <code>Button</code> in <code>Web form</code> and <code>onclick</code> event should open a report in new tab. I am using <code>onclientclick</code> property of <code>Button</code> but it enables all the other <code>Button</code> or <code>Radio Button</code> to redirect in new tab. How to prevent this.</p>
c# asp.net
[0, 9]
783,380
783,381
How to get soap address location attribute from wsdl document in JavaScript
<p>How can I get or retrieve the address location from this tag in JavaScript and Java?</p> <pre><code>&lt;soap:address location="http://www.webservicex.net/geoipservice.asmx"/&gt; </code></pre> <p>I am using this WSDL: <a href="http://www.webservicex.net/geoipservice.asmx?wsdl" rel="nofollow">http://www.webservicex.net/geoipservice.asmx?wsdl</a></p>
java javascript
[1, 3]
4,520,485
4,520,486
jquery .post elements created with append
<p>I have a code with input field, and with clicking on add it adds new input field with new name:</p> <pre><code>/* multiply recepient */ var number = 1; $('a.plus').live('click', function() { number += 1; $('.multiple').append('&lt;p&gt;&lt;input type="text" name="recepient_' + number + '"&gt;&lt;/p&gt;'); }); </code></pre> <p>this works fine. But then I want to post entered values with $.post() and only the first input fileld is posted, the original one, all created with append are note posted... Here is my post function:</p> <pre><code>$('input.submit').live('click', function() { var postdata = $('form#form1').serialize(); $.post('result.php', postdata, function(data) { $('div.result').html(data); }); return false; }); </code></pre> <p>any ideas?</p>
php jquery
[2, 5]
3,649,867
3,649,868
hasClass is not a function
<p>I was wondering if anyone could help out. The problem is quite simple though but I can't get it. I keep on getting this error message saying,</p> <blockquote> <p>TypeError : $(...)hasClass is not function.</p> </blockquote> <p>Can anyone help out here?:</p> <pre><code>$(function fade(){ $('#contentWrap &gt; div').hide(); $('#contentWrap &gt; div:first').show(); $('#container-5 a:first').addClass('active'); $('#container-5 ul li a').click(function fade() { if ($(this).hasClass('active') == true){ return false; }else{ $('a.active').removeClass('active'); $(this).addClass('active'); $('#contentWrap &gt; div').fadeOut(100); var contentToLoad = $(this).attr('href'); $(contentToLoad).fadeIn(5000); return false; } }); }); </code></pre>
javascript jquery
[3, 5]
404,055
404,056
jquery :last selector for multiple list
<p>I Have a navigation looking like this</p> <pre><code>&lt;ul class="navigation"&gt; &lt;li class="navlist"&gt; Navigation1 &lt;ul&gt; &lt;li&gt;point1&lt;/li&gt; &lt;li&gt;point2&lt;/li&gt; ... &lt;/ul&gt; &lt;/li&gt; &lt;li class="navlist"&gt; Navigation2 &lt;ul&gt; &lt;li&gt;point1&lt;/li&gt; &lt;li&gt;point2&lt;/li&gt; ... &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; etc (4 more navigations) .. </code></pre> <p>Now I want to select the last and add a class to it with jquery. Normaly I wont be a Porblem. But I have 5 Navigations like this in the code. And it's only adding the class to the last one using this selector </p> <pre><code>$('.navigation ul:last').addClass('last_border') </code></pre>
javascript jquery
[3, 5]
5,838,592
5,838,593
image control unable to display image
<p>my code is:</p> <pre><code>string filename = FileUploader.PostedFile.FileName.Substring(fuImage.PostedFile.FileName.LastIndexOf("\\") + 1); if(fuImage.HasFile) { FileUploader.SaveAs(Server.MapPath("Modules/NewUserProfile/UserPic/" + filename)); imgUser.ImageUrl = Server.MapPath("Modules/NewUserProfile/UserPic/" + filename); } </code></pre> <p><code>imgUser</code> is id of <code>asp:Image</code> Control.Image is uploaded in desire folder but its not display image in image control.What i am doing wrong here? Is there any postback issue.Thanks.</p>
c# asp.net
[0, 9]
3,151,435
3,151,436
Refreshing a button in Android
<p>I have set a content view in Android with: </p> <pre><code>setContentView(R.layout.activity_main); </code></pre> <p>Now after one of the buttons is clicked, the following code is executed to enable another button:</p> <pre><code>ok.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { buttonPause.setEnabled(true); ... </code></pre> <p>This enables the button. BUT only after a minute or so.</p> <p>Do I need to refresh the button or layout? Or is that bad practice? I am wondering what causes this delay. I have read about notifyDataSetChanged(), but I do not think that is the right method.</p>
java android
[1, 4]
4,490,639
4,490,640
Server side validation for required fields
<p>I am having an issue with the requiredfieldvalidator control not working on an ASP.net page. I have completed the attributes of that field properly, but when I test it, the postback is allowed to happen even if the field in question is blank. </p> <p>So I want to do server side validation instead. What is the best way to do that? In the event that caused the postback? Also, if I find out the field is blank, how do I get the user back to the screen with all other values they placed on other fields intact and a message saying "This field cannot be blank".</p> <p>EDIT:</p> <p>This is the code:</p> <pre><code>&lt;asp:TextBox ID="fName" TabIndex="1" runat="server" Width="221px" CausesValidation="True"&gt;&lt;/asp:TextBox&gt; &lt;asp:RequiredFieldValidator ID="FNameRequiredFieldValidator" runat="server" ControlToValidate="fName" InitialValue="" ErrorMessage="Filter Name cannot be blank." ToolTip="Filter Name cannot be blank."&gt;*&lt;/asp:RequiredFieldValidator&gt; </code></pre>
c# asp.net
[0, 9]
656,180
656,181
Send a mail using Javascript without going through Outlook
<p>Is it possible to Send a mail using Javascript without going through Outlook</p>
javascript asp.net
[3, 9]
2,729,294
2,729,295
Get enum values from web.config at run time
<p>I have an enum which I want to get from the web.config at run-time. I started reading about build providers, but this seems to work for classes. Can someone point me to an example, or at least point me in the right direction.</p> <p>Right now I have a comma separated list of values in the web.config, and this is not type-safe and is prone to errors.</p> <p>If there is another approach to get this type of "dynamic-enum", I'm open to other ideas.</p> <p>Thank you!</p>
c# asp.net
[0, 9]
1,848,694
1,848,695
Dynamically arranging divs using jQuery
<p>I have the following structure:</p> <pre><code>&lt;div id="container"&gt; &lt;div id="someid1" style="float:right"&gt;&lt;/div&gt; &lt;div id="someid2" style="float:right"&gt;&lt;/div&gt; &lt;div id="someid3" style="float:right"&gt;&lt;/div&gt; &lt;div id="someid4" style="float:right"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Now someid is acually a unique id for that div. Now i receive an array which has a different order say someid 3,2,1,4, then how do i move these divs around to match the new order using jQuery?</p> <p>Thankyou very much for your time.</p>
javascript jquery
[3, 5]
4,400,370
4,400,371
Next & Previous button
<p>I would like to add next and previous buttons so i can click through my images</p> <p>here is my example</p> <p><a href="http://scott-p.dmlive.co.nz/formatives/pf-wp/" rel="nofollow">http://scott-p.dmlive.co.nz/formatives/pf-wp/</a></p>
javascript jquery
[3, 5]
4,431,964
4,431,965
Android Java Notify does not trigger wait
<p>I'm trying to understand this concurrent programming with threads and I don't seem to get this wait() and notify()</p> <p>I suspect that it has something to do with one of my thread waiting forever and the notify is already called. But I don't know how to solve this. I read through others posts on stackoverflow, but could not understand it well. </p> <p>Here is my code and it would be helpful if someone could pinpoint me to the right direction.</p> <pre><code>package com.example.thread_android; import android.os.Bundle; import android.app.Activity; import android.util.Log; import android.view.Menu; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.d("Stage", "onCreate"); Runnable AthreadJob = new ARunnable(); Runnable BthreadJob = new BRunnable(); Thread myThreadOne = new Thread(AthreadJob); Thread myThreadTwo = new Thread(BthreadJob); myThreadOne.start(); myThreadTwo.start(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } class ARunnable implements Runnable{ @Override public void run(){ Log.d("Runnable", "A Inside Run - WAIT"); try{ synchronized(this){wait();} } catch (InterruptedException e) {} //Log.d("Runnable", "A Inside Run - CONTINUE"); } } class BRunnable implements Runnable{ @Override public void run(){ Log.d("Runnable", "B Inside Run"); synchronized (this) {notify();} } } </code></pre>
java android
[1, 4]
1,602,445
1,602,446
How do I make the $(window).height() doesn't go below what it started at?
<p>I am trying to console.log the window height with this code here:</p> <pre><code>var $win = $(window); $win.on('resize', update); function update () { console.log($win.height()); } </code></pre> <p>It sort of works, but it wont go below the height of my largest element. How can I make it so it will?</p>
javascript jquery
[3, 5]
5,951,073
5,951,074
DIsplaying DataSet in Editable format?
<p>assume I have a single row datatable with collums of diffrent type</p> <p>I want to bind them to a contorl that will allow the user to easily edit the data, winform style for example if data is of type <code>datetime</code> it will diplay a <code>datepicker</code>. <code>boolean</code> will be displayed as <code>checkbox</code>, <code>free string</code> as <code>textbox</code> and so on.. and if data is constrained to forgien key it will idplay combobox and so on. is there a ready contorl that provies this functionality?</p> <p>I cannot afford to pay for a control. third party free one would be awesome.</p>
c# asp.net
[0, 9]
4,142,214
4,142,215
Remove span using global variable in jQuery
<p>I create a span with a global variable like this:</p> <pre><code>var $span = jQuery('&lt;span&gt;&lt;/span'); jQuery($span).append('&lt;img src="myimage.gif"/&gt;'); jQuery($span).insertAfter('#username'); </code></pre> <p>It works but I would like to remove the span in some part of my code. I try with:</p> <pre><code>$span.remove(); </code></pre> <p>but it doesn't work. </p> <p>Thanks!</p>
javascript jquery
[3, 5]
5,317,684
5,317,685
jQuery variable with 0 (zero) value
<p>I have a variable that I past to a function called <code>comment_test</code> that will sometimes be <code>0</code>, but it fails because I guess it reads it as <code>false</code>. I get the error <code>'ReferenceError: Can't find variable: count'</code>.</p> <p>But, I need to know if the variable is indeed <code>0</code> (and not <code>1</code>, <code>2</code>, <code>3</code>, etc). The function works fine with any positive number. How is this achieved or what am I doing wrong? I can't seem to find any info on this.</p> <pre><code>var test = comment_test(0, true); </code></pre>
javascript jquery
[3, 5]