Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
3,060,094 | 3,060,095 | jquery toggle between forms | <p>I have ran out of ideas for this assignment for a class. I had to create two PHP forms using PHP_SELF and I am suppose to use javascript or jquery to toggle between the forms. I tried using</p>
<pre><code><a href="#" onclick="document.getElementById('form1').style.display = 'block'; document.getElementById('form2').style.display = 'hidden';">Form 1</a>
<a href="#" onclick="document.getElementById('form1').style.display = 'hidden'; document.getElementById('form2').style.display = 'block';">Form 2</a>
</code></pre>
<p>This does work on changing the forms, however when I hit the submit button the form it goes back to form 1 and doesn't display the results. The thing I have to figure out is after the form has been submitted using PHP_SELF, how to get it to stay on that form to show the results generated by the server.</p>
| php javascript jquery | [2, 3, 5] |
2,056,500 | 2,056,501 | jQuery: Why won't this scroller work? | <p>Now... clear your minds of anchor tags... I simply would like any li tag that's clicked to scroll downwards to a div with the id <code>#contentbox</code>...</p>
<p>Any ideas why this won't work or can you provide a working example of what does?</p>
<pre><code>$("li").click(function(event){
$('html,body').animate(
{ scrollTop: $('#contentbox').offset().top },
{ duration: 'slow', easing: 'swing'}
);
});
</code></pre>
| javascript jquery | [3, 5] |
679,151 | 679,152 | How to access getSharedPreferences from another class? | <p>I have build 2 projects my main one and a twitter posting one. I have imported the twitter one into the main and am now trying to hook it up. Below is the import code. The problem is I know I am missing something possibly to do with the context? I have just summarised what is contained in my main project below so you understand better (Hopefully).</p>
<pre><code>import com.tweet.t.TweetToTwitterActivity;
TweetToTwitterActivity twitter = new TweetToTwitterActivity();
twitter.buttonLogin(v);
</code></pre>
<p>Here is the TweetToTwitterActivity</p>
<pre><code>public class TweetToTwitterActivity extends Activity {
private SharedPreferences mPrefs;
/** Twitter4j object */
private Twitter mTwitter;
private RequestToken mReqToken;
public void buttonLogin(View v) {
mPrefs = getSharedPreferences("twitterPrefs", MODE_PRIVATE);
// Load the twitter4j helper
mTwitter = new TwitterFactory().getInstance();
// Tell twitter4j that we want to use it with our app
mTwitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
if (mPrefs.contains(PREF_ACCESS_TOKEN)) {
Log.i(TAG, "Repeat User");
loginAuthorisedUser();
} else {
Log.i(TAG, "New User");
loginNewUser();
}
}
</code></pre>
<p>The stacktrace points this line.</p>
<pre><code> mPrefs = getSharedPreferences("twitterPrefs", MODE_PRIVATE);
</code></pre>
<p>09-23 11:27:40.034: ERROR/AndroidRuntime(229): java.lang.NullPointerException
09-23 11:27:40.034: ERROR/AndroidRuntime(229): at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:146)
09-23 11:27:40.034: ERROR/AndroidRuntime(229): at com.tweet.t.TweetToTwitterActivity.buttonLogin(TweetToTwitterActivity.java:74)</p>
| java android | [1, 4] |
2,131,562 | 2,131,563 | Changes have no impact on loaded script | <p>After I have changed a JavaScript file I don't get the changes in <code>*.js</code> dynamic.
When I debug I see that no changes had any impact on the <code>*.js</code> dynamic.</p>
<p>What should I do to get the changes to make any impact?</p>
<p><strong>Background</strong></p>
<p>I have changed the page with a component that to be dydnamisk between two different components that are placed in a placeholder. To access the control I change the JavaScript with <code>placeholder.contControls[0]</code> to get a property in the control to be write to.</p>
| javascript jquery asp.net | [3, 5, 9] |
4,580,180 | 4,580,181 | jQuery clone() problem | <p>I am using jquery to clone a form input field when user click on Add button everything goes fine, but I have a problem that if I write something in form input field and click Add button, then jQuery will copy that text into new cloned input element also.</p>
<p>You can try a demo: <a href="http://jsbin.com/ikebil/2/edit" rel="nofollow">http://jsbin.com/ikebil/2/edit</a></p>
<p>Steps:</p>
<ol>
<li><p>Open the link and click render </p></li>
<li><p>Type something in input field </p></li>
<li><p>Click on add button it will create a new input field but also copy the text written in the previous one.</p></li>
</ol>
<p>Original code: <a href="http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/" rel="nofollow">http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/</a></p>
<p>So I need to remove that text which comes if anything is written in the previous element.</p>
| javascript jquery | [3, 5] |
537,293 | 537,294 | Go Back to Previous Page | <p>I am using a form to "Rate" a page. This form "posts" data to a php script elsewhere. I simply want to display a link after the form is processed which will bring the user back to previous page. Can I do this using javascript in my php script?</p>
<p>GF</p>
| php javascript | [2, 3] |
4,406,363 | 4,406,364 | Passing data from PHP to JavaScript | <p>I have a simple php variable i need to carry over to a javascript part.</p>
<p>Code:</p>
<pre><code><?php
if ($p == 'home') { $selected == '0'; }
if ($p == 'music') { $selected == '1'; }
if ($p == 'videos') { $selected == '2'; }
if ($p == 'search') { $selected == '3'; }
if ($p == 'about') { $selected == '4'; }
if ($p == 'contact') { $selected == '5'; }
?>
<script type="text/javascript">
//SYNTAX: tabdropdown.init("menu_id", [integer OR "auto"])
tabdropdown.init("colortab", $selected) <-- $selected is the variable I want to carry over
</script>
</code></pre>
| php javascript | [2, 3] |
2,083,909 | 2,083,910 | Set size for Input item using JQuery | <p>There is the following code:</p>
<pre><code>$(".translated").mouseenter(function(){
if ($(this).hasClass("editable")){
return;
}
var h=$(this).height();
var w=$(this).width();
$(this).empty();
$("<input/>", {
type: "text",
height:h,
width:w,
value:$(this).text()
}).appendTo(this);
$(this).height(h);
$(this).width(w);
$(this).addClass("editable");
});
</code></pre>
<p>This code removes text from a <code><div></code> container and inserts an <code><input></code> item into it. But there is the problem: the new <code><input></code> item has height larger than the <code><div></code> container despite the values of the <code>h</code> and <code>w</code>. How can I fix it? </p>
| javascript jquery | [3, 5] |
4,926,621 | 4,926,622 | how to select specific text in textbox | <p>is there any way to select the specific text of the textbox using jquery or javascript. </p>
| php javascript jquery | [2, 3, 5] |
888,916 | 888,917 | jQuery Swap Image on Click and if/else | <p>Im stuck, Im setting a variable when someone clicks, then testing with if to see if the variable exists and doing something else. Its a simple script which Im probably overthinking, would love someone's thoughts.</p>
<pre><code> $('.view-alternatives-btn').live('click', function() {
//$("#nc-alternate-wines").scrollTo();
//$('.nc-remove').toggle();
var showBtn = null;
if (showBtn == null) {
$('.view-alternatives-btn img').attr("src","../images/wsj_hide_alternatives_btn.gif");
$('#nc-alternate-wines').show();
showBtn = 1;
console.log(showBtn);
}
else if (showBtn == 1) {
$('.view-alternatives-btn img').attr("src","../images/wsj_view_alternatives_btn.gif");
$('#nc-alternate-wines').hide();
console.log("this " + showBtn);
}
return false;
});
</code></pre>
| javascript jquery | [3, 5] |
116,061 | 116,062 | Mouseleave only when mouseenter ends | <p>with the follow code:</p>
<pre><code>$('someelement').hover(
function() {
console.log('mouseenter begin');
setTimeout(function() {
console.log('mouseenter ends');
}, 2000);
},
function() {
console.log('mouseleave begin');
setTimeout(function() {
console.log('mouseleave ends');
}, 2000);
}
)
</code></pre>
<p>If I enter and leave div at some times (or one time less then 2 seconds) my console get:</p>
<pre><code>mouseenter begin
mouseleave begin
mouseenter ends
mouseleave ends
</code></pre>
<p>I want mouseleave only executed when <code>mouseenter</code> ends, but don't know how.</p>
<pre><code>mouseenter begin
mouseenter ends
mouseleave begin
mouseleave ends
</code></pre>
| javascript jquery | [3, 5] |
270,729 | 270,730 | CS0433 Compilation Error | <p>Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p>
<blockquote>
<p>Compiler Error Message: CS0433: The
type 'mmet.rgen' exists in both
'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET
Files\mail\d77eac0c\a5fb2812\assembly\dl3\c6e9aa33\e7f7b4c8_463acc01\WebMail.DLL'
and
'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET
Files\mail\d77eac0c\a5fb2812\App_Code.n0dshhx5.dll'</p>
</blockquote>
<p>I created an web application in Visual studio 2010 and copied that code in to my project which is running on its own compiler using a batch file. After I am running this application in IIS 7.5 I am getting this error. I reinstalled OS and tried but no use. When I delete temporary files in .NET framework folder I am getting an error as "Source not found"</p>
| c# asp.net | [0, 9] |
4,129,394 | 4,129,395 | 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] |
1,149,533 | 1,149,534 | How to put one buttom right and another left | <p>I try to create dynamically linerlayout and i created two buttoms.</p>
<pre><code>LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.HORIZONTAL);
layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
TextView titleView = new TextView(this);
titleView.setWidth(LayoutParams.WRAP_CONTENT);
titleView.setHeight(LayoutParams.WRAP_CONTENT);
titleView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
titleView.setText("Hallo Welt!");
layout.addView(titleView);
Button btnConnect = new Button(this);
btnConnect.setText("Connect");
layout.addView(btnConnect);
Button btnDisconnect = new Button(this);
btnDisconnect.setText("Disconnect");
layout.addView(btnDisconnect);
</code></pre>
<p>I want to put Connect button to left corner and want to put disconnet button to the right corner. How can i do that?</p>
| java android | [1, 4] |
5,677,190 | 5,677,191 | e.stopPropagation() - is the clicked element a propagation or the original? | <p>How can you check whether the element is the original element or a propagation of the clicked element?</p>
<hr>
<h3>Edit</h3>
<p>If I do this, <code>'propagation'</code> is always alerted:</p>
<pre><code>this.row.click(function(e){
if(e.target === this) alert('origin');
else alert('propagation');
//e.stopPropagation();
});
</code></pre>
| javascript jquery | [3, 5] |
926,703 | 926,704 | Phone number formatting validation | <p>How would I validate with Javascript/jQuery that a phone number matches the format of +322123456?</p>
<ol>
<li>The +32 is mandatory, and the phone number begins with it.</li>
<li>After the +32, 8 or 9 numbers</li>
</ol>
| javascript jquery | [3, 5] |
3,385,748 | 3,385,749 | Android multiple EditorActionListeners on single EditText field | <p>I have multiple action listeners defined for single EditText field,
one in the Activity:</p>
<pre><code>editText.setOnEditorActionListener(this);
</code></pre>
<p>and another in the View definition:</p>
<pre><code>editText.setOnEditorActionListener(new EditText.OnEditorActionListener() {...});
</code></pre>
<p>Is there a way for both listeners to run? Now only the one in the Activity runs.
I can't change(simplify/refactor) the code to make all this be at single place(because it's complicated as hell).
Thanks ahead!</p>
| java android | [1, 4] |
5,994,647 | 5,994,648 | Search through an HTML Table and find text fields with required classes | <p>I'm creating a validation script for a multi-step form, each group is inside a table and I want to check that the containing table has a required field inside it.</p>
<p>I've tried to implement this as below:</p>
<p>(where a = table id
.required = class, but the classes are like class = "something required")</p>
<pre><code>function validForm(a) {
var myVar = $('a').find('.required').val();
alert(myVar);
}
</code></pre>
<p>the problem is that this code returns <em>undefined</em>. This is my first time using a <code>.find</code> function and I am having a hard time understanding how to use it.</p>
<p>HTML:</p>
<pre><code><table id = "default">
<tr><td>Default</td></tr>
<tr><td>Field name</td><td><input type="text" name="first_name" maxlength="35" class="txtfield-cu1 required" title="First Name"></td></tr> <- repeat a couple of times
</code></pre>
| javascript jquery | [3, 5] |
5,847,157 | 5,847,158 | jquery select iframe children | <p>I am using the editArea library and jquery to do what i need...</p>
<p><a href="http://www.cdolivet.com/index.php?page=editArea&sess=2b8243f679e0d472397bfa959e1d3841" rel="nofollow">http://www.cdolivet.com/index.php?page=editArea&sess=2b8243f679e0d472397bfa959e1d3841</a></p>
<p>so in my html there is an iframe tag that editArea uses what i need is to access something like so with jquery</p>
<pre><code>$('iframe textarea').keydown(function (e){
number = 17; //any number really :)
if(e.which == number){
//do something...
alert('Done...');
}
});
</code></pre>
<p>I tried the above but it looks like it is not detecting that key. but it works if selector was $(document)
therefore the rest of the function works it's just it's not picking up the iframes textarea keydown</p>
<p>any ideas?
Thanks</p>
| javascript jquery | [3, 5] |
2,344,611 | 2,344,612 | how to make string bold in code behind | <p>Is there a way to make a string bolder in code behind using c#, .NET. I tried </p>
<pre><code>string TypeofDay = "<span style='font-weight: bold'>Type Of Day</span> ";
txtbox.Text = TypeofDay + ": " + "Delivery Day"
</code></pre>
<p>I am concatenating TypeofDay(bold) and "Delivery Day" to display in a textbox. </p>
<p>Thanks in advance!! </p>
| c# asp.net | [0, 9] |
3,280,703 | 3,280,704 | sql asp.net send email c# | <p>if you could please help me out... i am try to create o forgot password method.access my database and send an e-mail. if you please help me out since i don't have a lot of experience. thanking you in advance. Login is unique. C# </p>
<pre><code>protected void LinkButton1_Click(object sender, EventArgs e)
{
var sqlCon = new SqlConnection(System.Configuration.ConfigurationManager.
ConnectionStrings["ConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = sqlCon;
cmd.CommandText = "select Password from Person where Login= @Login ";
cmd.Connection.Open();
string Password = cmd.ExecuteScalar().ToString();
cmd.Connection.Close();
cmd.Dispose();
SqlCommand cmd1 = new SqlCommand();
cmd1.Connection = sqlCon;
cmd1.CommandText = "select e_mail from Person where Login= @Login ";
cmd1.Connection.Open();
string e_mail = cmd.ExecuteScalar().ToString();
cmd.Connection.Close();
cmd.Dispose();
if (Login.Text.Equals("@Login"))
{
Class1 S = new Class1();
S.sendMail(e_mail, "Your Password request", Password);
Response.Write("<script>");
}
}
</code></pre>
| c# asp.net | [0, 9] |
693,530 | 693,531 | Reflection java.lang.ClassNotFoundException | <p>I am using the following: </p>
<pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
switch(requestCode){
case EDIT_ADJUSTMENT:
if(resultCode == RESULT_OK){
try{
String adjustment = data.getStringExtra("adjustment");
adjustment = adjustment.replace(" ", "");
ClassLoader myClassLoader = ClassLoader.getSystemClassLoader();
String classNameToBeLoaded = "com.picpic.adjustments." + adjustment;
Class adjust = myClassLoader.loadClass(classNameToBeLoaded);
}catch(Exception e){
String msg = e.getMessage();
}
}
break;
}
}
</code></pre>
<p>When it gets to <code>Class adjust = myClassLoader.loadClass(classNameToBeLoaded);</code> I get the following Exception: <code>java.lang.ClassNotFoundException: com.picpic.adjustments.ColorCorrect</code></p>
<p>The package of <code>ColorCorrect</code> is <code>com.picpic.adjustments</code></p>
<p>So, Why is that error being thrown? Please let me know if you need more information. Thanks!</p>
| java android | [1, 4] |
5,498,250 | 5,498,251 | How to activate mouseleave, if it has been x amount of time? | <p>So, I've got this type of situation, but I only want to "Do something" if the user "mouseleave(s)" for more than x amount of time, say one second. How should I implement that?</p>
<pre><code>$("#someElement, #someOtherElement").mouseleave(function() {
// Do something.
});
</code></pre>
<p>Later I added:</p>
<pre><code> $('.popover3-test').popover({
placement:'bottom',
template: $('.popover2'),
trigger: 'manual',
}).mouseenter(function(e) {
$(this).popover('show');
$(".popover3-test, .popover2").each(function() {
var t = null;
$(this)
.mouseleave(function() {
t = setTimeout(function() {
$('.popover2').hide();
}, 1000); // Or however many milliseconds
})
.mouseenter(function() {
if(t !== null)
clearTimeout(t);
})
;
});
});
</code></pre>
| javascript jquery | [3, 5] |
2,860,965 | 2,860,966 | JQuery TR Verticle Scroller? | <p>I know there are JQuery plugins out there for verticle scrolling of lists but I have a table and would like to vertically scroll the</p>
<p>Is this possible?</p>
| javascript jquery | [3, 5] |
5,131,112 | 5,131,113 | find out if a certain id itself has certain text part of it | <p>I got the id of a clicked element from the site, and i need to check if the id has a certain word. (all the id start with same word but have also a number which is efferent for all).<br>
How can i do that with jquery?</p>
| javascript jquery | [3, 5] |
3,455,927 | 3,455,928 | How to open a popup window and bind to the popup window close? | <p>I'm opening a popup as follows:</p>
<pre><code>popup = window.open(url, "", "width=600,height=300,status=no,scrollbars=no,resizable=no");
popup.focus();
</code></pre>
<p>What I want to do is refresh the opener when the popup closes. Is this possible? Thanks</p>
| javascript jquery | [3, 5] |
5,650,899 | 5,650,900 | Selection in Date Control | <p>Now, I am working with asp.net , C# and I have made custom controls . In my custom controls especially in Date control, I want to select only month and day part in OnFocus Event.
Right Now, I have wrote </p>
<pre><code>control.select();
</code></pre>
<p>then , as usual, the text of the control(2012/08/04) will be selected.</p>
<p>But now I want to give selection only on the part of the month and day(08/04). I am searching many ways to do it. But I haven't got any ways until now. So I would like to know that Can I give a selection on only month and day part(08/24) of a Date Control.</p>
<p>With regards</p>
| c# asp.net | [0, 9] |
5,501,106 | 5,501,107 | Sharepoint mechanism to add scripts to aspx page? | <p>(a) Is there a mechanism (by sharepoint) of registering to include a script into the aspx page?</p>
<p>(b) If yes, then if I do the following from a user control what would be the result?</p>
<pre><code>Debug.Print(this.Page.ClientScript.IsClientScriptIncludeRegistered("foo"));
</code></pre>
<p>Assume that <code>foo</code> is the name of script-include which I have somehow registed by some sharepoint mechanism [i.e. (a)]</p>
| javascript asp.net | [3, 9] |
5,513,905 | 5,513,906 | Objects of Java and C++ | <p>The Java <code>Object</code> has some methods like <code>toString</code>, <code>hashCode</code>, <code>equals</code>, etc. Does an object in C++ have some builtin methods? What are the actual differences between an object in C++ and Java?</p>
| java c++ | [1, 6] |
1,424,400 | 1,424,401 | jQuery to validate a form (check for atleast 10 characters and certain value) | <p>On my webpage I have a form where a user enters information for their article. Right now I use jQuery to check if the entered values are not empty, if they are I show an error message.</p>
<p><strong>Current validation</strong></p>
<pre><code>//Story Form
$('.error').hide(); //Hide error message initially
$(".button").click(function() { //On button click
$('.error').hide();
var title = $("input#sc_title").val();
if (title == "") { //if title is empty
$("label#title_error").show(); //show error
$("input#sc_title").focus(); //focus on title field
return false;
}
});
</code></pre>
<p>Right now it only checks if <code>title == ""</code>. How would I edit the code to also check if there are at least 10 characters entered e.g. if title is empty and less than 10 chars are entered, show an error?</p>
| javascript jquery | [3, 5] |
5,374,816 | 5,374,817 | using managed c++ dll in c# | <pre><code>**unmanaged class**
</code></pre>
<p>this is the unmanaged class declaration</p>
<pre><code>#ifdef EXPORT_CLASS
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT __declspec(dllimport)
#endif
public class DLL_EXPORT cppclass
{
private:
string x;
public:
cppclass();
~cppclass();
string native();
};
**UNMANAGED CLASS DEFINITION**
</code></pre>
<p>this is the unmanaged class definition</p>
<pre><code> cppclass::cppclass()
{
x="hello";
};
cppclass::~cppclass()
{
};
string cppclass::native()
{
return x;
};
**MANAGED CLASS**
</code></pre>
<p>this is the managed class declaration</p>
<pre><code>public __gc class Mclass
{
//private:
public:
cppclass * obj;
public:
Mclass();
~Mclass();
string native();
</code></pre>
<p>};</p>
<pre><code>**MANAGED CLASS DEFINITION**
</code></pre>
<p>//this is the managed class definition</p>
<pre><code>#include"managed.h"
Mclass::Mclass()
{
obj=new cppclass();
};
Mclass::~Mclass()
{
delete obj;
};
string Mclass::native()
{
return obj->native();
};
Now all this is made into a dll and imported in a c# project
using managed;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
managed.Mclass first = new Mclass();
String x=first.nativ();
Console.Out.WriteLine(x);
}
}
</code></pre>
<p>}</p>
<p>error comes that Managed.Mclass.nativ() is not supported by the language</p>
| c# c++ | [0, 6] |
4,393,039 | 4,393,040 | Javascript resize on every image load | <p>I've got this code:</p>
<pre><code>while ($row = mysql_fetch_assoc($result1)) {
echo "
<a href='#'id='VV".$row['id']."'>
<p>".$row['title']."</p>
<p>".$row['date']."</p>
<img onload='scale()' id='II".$row['id']."' src='../res/videos/img/".$row['img']."'/>
</a>
<script type='text/javascript'>
function scale(){
var image = document.getElementById('II".$row['id']."');
var width = image.width;
var height = image.height;
if (width > 150) {
image.style.width = '150px';
image.style.height = 'auto';
}
width = image.width;
height = image.height;
if (height > 80) {
image.style.height = '80px';
image.style.width = 'auto';
}
width = image.width;
height = image.height;
}
VV".$row['id'].".onclick = function() {
var Result = '".$row['id']."';
location.href='loged.php?Result=' + Result;
}
</script>
";
}?>
</code></pre>
<p>I want the resize function be called on every image loaded, but it is called when the last image is loaded, and only the last image takes effect. What should i change?</p>
| php javascript | [2, 3] |
5,856,308 | 5,856,309 | jquery replace text with image, help | <pre><code>("*").each(function () {
if ($(this).children().length == 0) {
$(this).text($(this).text().replace('basketball','test'));
}
});
</code></pre>
<p>i'm only able to change the text to another string of text, but how can I pass an image?</p>
| javascript jquery | [3, 5] |
4,674,928 | 4,674,929 | Eval with complex business child object | <p>I have a class Employee with fields Name and OfficeAddress.OfficeAddress again is an object of type Address.
Address is a class with fields Building,City and Country.
I have list of employee called empList.Now I want to bind this empList to a gridview so that it should display Name,Building,City and Country.
The problem is gridview cannot find properties Building,City and Country in empList when I bind gridview using Eval("Building") or Eval("City") or Eval("Country").Please provide me the syntax to bind these columns.</p>
| c# asp.net | [0, 9] |
5,744,250 | 5,744,251 | jQuery Scroll function after 100px | <p>Using this script:</p>
<pre><code><script>
$(function() {
$(window).scroll(function(){
$('#Your element id').slideUp('slow');
});
});
</script>
</code></pre>
<p>Is it possible only to perform the action after the user has scrolled 100px or more?</p>
| javascript jquery | [3, 5] |
4,275,474 | 4,275,475 | get the html element after created | <p>i'm creating a img when i click in a input, then i get the html or anyelse from the created img.</p>
<p>but i dont know why this is not working!</p>
<p>always return <code>null</code></p>
<p>my js:</p>
<pre><code>$("#click").click(function(){
var $imgDone = $('<img/>').attr('src', 'someImage/insomewhere.jpg');
$(this).after($imgDone);
setTimeout(function(){
alert($(this).next().html());
}, 1000);
});
</code></pre>
<p>i mande a exp.: <a href="http://jsfiddle.net/frGpx/14/" rel="nofollow"><strong>Demo</strong></a></p>
| javascript jquery | [3, 5] |
5,413,420 | 5,413,421 | Easier way to select ith jQuery object of group than $($(".someclass")[i]))? | <p>So I'm trying to cycle through the members of "someclass", not the DOM elements but their jQuery counterparts. I've been using $($(".someclass")[i]), but this is pretty ugly. Is there a more natural way to do this?</p>
| javascript jquery | [3, 5] |
5,464,624 | 5,464,625 | How to make entire box in dropdown menu (menuitem) clickable instead of just the text? | <p>I have a menu bar with different items, with sub items, </p>
<pre><code> //ASCX FILE
<asp:MenuItem Text="Item" Value="Item" Selectable="false">
<asp:MenuItem Text="SubItemA" Value="SubitemA" NavigateUrl="dsklfsl.com"
</asp:MenuItem>
<asp:MenuItem Text="SubItemB" Value="SubitemB" NavigateUrl="ghhffssl.com"
</asp:MenuItem>
</asp>
</code></pre>
<p>The problem is that if I hover over Item, then SubItemA, I am only able to click when I am hovering over exactly the text "SubItemA", is there a way to set it so that if I hover anywhere in the box containing the text "SubItemA", I will be able to click there as well?</p>
<p>I have looked through the different properties for MenuItems but I haven't been able to find anything , its possible I missed something thought.</p>
| c# asp.net | [0, 9] |
5,461,771 | 5,461,772 | Codeigniter 2.1, Jquery - delete all checkboxes checked | <p>At the moment, I am confused by this problem. How can I delete all files that have been checked?
This is the function to select or unselect checkboxes:</p>
<pre><code>var del_selected = $('.zute_strane_izmena_obrisi_sve'),
del_url = del_selected.attr('href'),
selektuj_sve = $('.zute_strane_izmena_selektuj_sve'),
slike = $('.zuta_strana_trenutne_slike'),
box = slike.find(':checkbox'),
selektovane_slike = [];
selektuj_sve.on('click', function(){
$(this).text(box.is(':checked') ? 'Selektuj Sve Slike' : 'Deselektuj Sve Slike');
box.attr('checked', !box.is(':checked'));
});
</code></pre>
<p>Jquery for now (it is working without error):</p>
<pre><code>del_selected.on('click', function(e){
box.filter(':checked').each(function(){
selektovane_slike.push($(this).val());
$(this).parent().slideUp('fast');
});
data = JSON.stringify(box.serializeArray(), null, 2);
console.log(data);
e.preventDefault();
});
</code></pre>
<p>Where to go from here?</p>
| javascript jquery | [3, 5] |
101,608 | 101,609 | How can I get the div information via js? | <p>For example, I have div named $(".aDiv"), how can I get the $(".aDiv") position, and the information about $(".Div") using js? thank you.</p>
| javascript jquery | [3, 5] |
3,687,761 | 3,687,762 | Java to C# - intValue() equivalent in c# | <p>I am trying to re-write a piece of code which was in Java to C#, and I ran into a problem, basically I am creating a method which returns a string, but the string returned from c# and java is not the same, therefore the code is fauly. One problem is the following code, </p>
<p>I have this Java Code:</p>
<pre><code>Double localDouble1 = new Double(d1 / 100.0D);
int l = localDouble1.intValue();
</code></pre>
<p>And I want to re-write it in C#, I have tried </p>
<pre><code>Double localDouble1 = d1 / 100.0D;
int l = Convert.ToInt32(localDouble1);
</code></pre>
<p>It compiles and works, but the result is different, in my particular scenario, the Java int l variable contains 0, and the c# one returns 1.</p>
<p>Is there a better method to achieve what I need to do, the same as in Java.</p>
| c# java asp.net | [0, 1, 9] |
125,821 | 125,822 | what kind of error this Server Error in '/' Application | <p>Server Error in '/' Application.</p>
<p>Runtime Error</p>
<p>Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. </p>
<p>Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".</p>
<p>
</p>
<p>Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.</p>
<p>
</p>
| c# asp.net | [0, 9] |
1,571,361 | 1,571,362 | Javascript alert when user closes the tab ot the window | <p>I want when a user closes the tab or window or when he tries to move to another location different from my site to pops a confirm box, and if he confirm to execute an ajax script and then to close or change the window. I don't know how to do that. PS: I'm using jQuery.</p>
| javascript jquery | [3, 5] |
491,495 | 491,496 | How to replace entire contents of iframe? | <p><a href="http://stackoverflow.com/questions/5784638/replace-entire-content-of-iframe">This question</a> didn't receive any satisfactory answers, so I'm asking again.</p>
<p>I can get my iframe like this:</p>
<pre><code>var iframe = document.getElementById('preview');
var win = iframe.contentWindow;
var doc = win.document;
</code></pre>
<p>And write some initial HTML to it like this:</p>
<pre><code>doc.write('<!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="reset.css"></head><body>blah blah</body></html>');
</code></pre>
<p>And that works great, but now I want to replace the entire thing with some new content. How can I do that?</p>
<p>To be clear, by "entire thing" I mean the <code><head></code> too. I need to link some external JS and CSS there.</p>
<p>Preferably, this would also include the <code><!DOCTYPE></code>, but it's non-essential at this point.</p>
| javascript jquery | [3, 5] |
1,016,192 | 1,016,193 | Using ThreadPoolExecutor and AsyncTask | <p>When using ThreadPoolExecutor can I use AsyncTask as the Runnable in my queue? Or does this defeat the purpose?</p>
<pre><code>//A holder for various tasks
private final LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(5);
//Thread Pool Executor
private final ThreadPoolExecutor tpe = new ThreadPoolExecutor(3, 3, 10, TimeUnit.SECONDS, queue);
</code></pre>
| java android | [1, 4] |
1,600,443 | 1,600,444 | pass parameter from cs class to aspx.cs | <p>I am developing a web application that has .cs classes and aspx.cs classes. I want to send parameters from class.cs to anther aspx.cs class and my question is,
How can i pass parameters from class.cs to aspx.cs code behind?</p>
| c# asp.net | [0, 9] |
3,448,681 | 3,448,682 | how to call webservicemethod in windows service | <p>Basically my idea is to develop a proxy which will run in windows</p>
<p>I have created windows service application which running successfully and i have integrated a web service code in the windows service application running in windows service.</p>
<p>How to call that web service method when the client hits my url?</p>
<p>How to form the url which can call web service method to get the method return value?</p>
| c# asp.net | [0, 9] |
833,035 | 833,036 | Return false doesnt work | <p>i think my <code>return false</code> code isnt working properly. Take a look:</p>
<pre><code> $(".home .options .tabs ul li a").click(function(e){
var qual = $(this).attr("href");
$(".content.home .options .tabs ul li").removeClass("active");
$(this).parent().addClass("active");
$(".content.home .options .holder .tab").hide();
$(".content.home .options .holder "+qual).show();
return false;
});
</code></pre>
<p>Here's my html code:</p>
<pre><code> <div class="tabs">
<ul>
<li class="active"><a href="#lancamentos">Lançamentos</a></li>
<li><a href="#obras">Em Obras</a></li>
<li><a href="#prontos">Prontos para Morar</a></li>
</ul>
</div><!-- tabs -->
</code></pre>
<p>When i click, it does not go to the link, but jumps the page. Whats happening?</p>
<p>thanks!</p>
<p><strong>UPDATE</strong></p>
<p>Ok, i have updated the code. And still not working.</p>
| javascript jquery | [3, 5] |
5,691,090 | 5,691,091 | How to check if checkbox is checked inside a particular form? | <p>I created a jQuery function to check if a checkbox is checked like so:</p>
<pre><code>if ($('input:checkbox:checked').length > 0){ }
</code></pre>
<p>I have two set of check boxes in two separate forms. When I use above code it checks for checkboxes in both forms. I want the <code>if</code> condition only for one form. How can I achieve it?</p>
| javascript jquery | [3, 5] |
1,493,035 | 1,493,036 | jquery: i have to use parseInt() even when deal with numbers, why? | <p>i have the following script</p>
<pre><code><select id="select1">
<option value="1">1day</option>
<option value="2">2day</option>
<option value="3">3day</option>
</select>
<select id="select2">
<option value="1">1day</option>
<option value="2">2day</option>
<option value="3">3day</option>
</select>
</code></pre>
<p>and jquery</p>
<pre><code>$("#select2").change(function() {
var max_value = parseInt($("#select2 :selected").val());
var min_value = parseInt($("#select1 :selected").val());
if(max_value < min_value)
{
$("#select1").val($(this).val());
}
});
</code></pre>
<p>and now, what i can't understand anyway - if values of option elements are integer numbers, why i have to use parseInt()? in some cases it doesn't work without parseInt().</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
871,021 | 871,022 | How to bind event to element dynamically with jquery | <p>Does anybody know how to bind event handler to element if this element was uploaded with ajax? I have js file which is included into page header. Body of the page updated by ajax. I have tried <code>live()</code> and <code>bind()</code> methods. </p>
| javascript jquery | [3, 5] |
4,626,361 | 4,626,362 | How to send SMS from asp.net application | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1125332/sms-from-our-site">sms from our site</a> </p>
</blockquote>
<p>I want to send SMS from my asp.net application. Suppose there will be 2 text boxes in my UI, one for mobile or cell phone number and another one is for message writing. When I will click the submit button then this SMS will be send to that cell number.
I want to use my cell phone number as transmission number.
Please inform me the possible ways.
I am using asp.net C# </p>
| c# asp.net | [0, 9] |
4,581,568 | 4,581,569 | Remove QueryString Variable in c# | <p>I am very beginner With Programming...(unfortunately)</p>
<p>I want to remove Any added QueryString To Address after i get the variables. for example:</p>
<p>www.websiteName.com/page.aspx?a=344&b=233</p>
<p>i will get a and b and after that i want my address to look like this: </p>
<p>(www.websiteName.com) . </p>
<p>"root location". </p>
<p>any help...</p>
<p>thanks.</p>
| c# asp.net | [0, 9] |
1,773,943 | 1,773,944 | In Java, how to convert a String to JSON Object? | <p>The string is like so:</p>
<pre><code>[{"Id":287,"Name":"aaaaaaaa","ProjectType":"GP"}, ... snip ...]
</code></pre>
<p>This STRING is not JSON yet since it is a string even though it was served up as JSON.</p>
<p>I am trying to convert that to a structure that I can work with in my Java app.</p>
<p>Can somebody help me out here. The examples I've found so far didn't work out for me. Basically, I was hoping to be able to iterate over the Dictionaries that are within the List.</p>
<p>My latest attempt to convert the string into a json, was this:</p>
<pre><code>JSONObject data = new JSONObject(json_string);
</code></pre>
<p>This, however, returned <code>null</code>.</p>
<p>Thank you.</p>
| java android | [1, 4] |
4,097,386 | 4,097,387 | using PHP in external JS | <p>I have a big validation JS script. I want to put this script to be external JS.</p>
<p>Everything works fine with this, but in the JS i use cookie to handle the my user form junctions.</p>
<p>And besides, i use PHP in this JS. </p>
<p>If the JS in the html, then works. But if i put it to external, then no.</p>
<p>For example:</p>
<p>External JS:</p>
<pre><code>$(document).ready(function() {
var test = $.cookie('tet');
$.cookie('tet','8');
<?php
if (isset($_SESSION['main_check_a'])) {
echo "$.cookie('tet','1');";
?>
}}
</code></pre>
<p>}</p>
<p>How can i pass this PHP code to my external JS?</p>
| php javascript | [2, 3] |
4,167,173 | 4,167,174 | Register JavaScript from within a UserControl in ASP.NET | <p>I declare my javascript in the design page of a usercontrol (ascx). Is there a way to register this javascript block in the Head section? I don't want to use ClientScript.RegisterClientScriptBlock as I don't want to declare my javascript in the code-behind. I also cannot move it (entirely) into a separate file, because I use business logic to create it.</p>
| javascript asp.net | [3, 9] |
4,589,536 | 4,589,537 | how to test if two elements are the same | <p>I have a list of items that can be hidden/unhidden via JS be clicking them. The currently open item is stored in a variable, <code>openActivity</code>. Only one item can be opened at a time. I want to check in the click() event whether the clicked item is the same as the already opened item, so that it does not do a double-animation of it closing and then opening. I would suspect this to work at first:</p>
<pre><code>if (openActivity == $(this)) alert('hello');
</code></pre>
<p>But it does not. I noted this does not work either:</p>
<pre><code>if ($(this) == $(this)) alert('hello'); //never alert()s !
</code></pre>
<p>Here's all most relevant code, if it's worth anything to you (you may not have to look at this):</p>
<pre><code>openActivity = null;
$('.activityOuterContainer').click(function () {
if (openActivity !== null) {
if (openActivity == $(this)) alert('hello');
activityExtra(openActivity).slideUp();
activityToggle(openActivity).css('background-position', '0 0');
}
openActivity = $(this);
activityExtra(openActivity).slideDown();
activityToggle(openActivity).css('background-position', '0 -20px');
});
function activityToggle(a) {
return a.closest('.activityOuterContainer').find('.activityToggle');
}
function activityExtra(a) {
return a.closest('.activityOuterContainer').find('.activityExtra');
}
</code></pre>
<p>And one of the items:</p>
<pre><code><div class="activityOuterContainer">
<div class="activityContainer">
<div class="activityFormContainer">
name here
<div class="activityExtra">
<p>extra</p>
</div>
</div>
<div class="activityIsUsed">checkbox here</div>
</div>
<div class="activityToggle"></div>
</div>
</code></pre>
| javascript jquery | [3, 5] |
4,992,008 | 4,992,009 | using sha1prng in both android and windows giving different sequences | <p>I have used sha1prng in both my android program and java program as the pseudo ramdom number generator algorithm. I seeded both of them with the same value. <br><br>
But the sequesnce generated in android is different from the one generated in java. Why is this happening and what is the solution to this problem?</p>
| java android | [1, 4] |
895,645 | 895,646 | Error: objectdatasource could not find a non-generic method | <p>I am binding dropdown list using Object data source. I got an error like this </p>
<p><strong>"ObjectDataSource 'objDSStatus' could not find a non-generic method 'GetIssueAllowedStatusByCategoryIDStatusIDandUserType' that has parameters: IssueCategoryID."</strong></p>
<p>My code is as follows</p>
<h2>.aspx</h2>
<pre><code>< asp:DropDownList ID="ddlStatus" runat="server" DataSourceID="objDSStatus"
DataTextField="IssueStatusName" DataValueField="IssueStatusID">
< /asp:DropDownList>
< asp:ObjectDataSource ID="objDSStatus" runat="server" TypeName="DA"></asp:ObjectDataSource>
</code></pre>
<h2>.cs</h2>
<pre><code>private void Bind(int IssueCategoryID, int IssueStatusID, int UserType)
{
ddlStatus.Items.Clear();
objDSStatus.SelectMethod = "GetIssueAllowedStatusByCategoryIDStatusIDandUserType";
objDSStatus.SelectParameters.Clear();
objDSStatus.SelectParameters.Add("IssueCategoryID", IssueCategoryID.ToString());
objDSStatus.SelectParameters.Add("IssueStatusID", IssueStatusID.ToString());
objDSStatus.SelectParameters.Add("UserType", UserType.ToString());
objDSStatus.DataBind();
ddlStatus.DataBind();
}
</code></pre>
<h2>DA.cs</h2>
<pre><code>public List<IssueStatus> GetIssueAllowedStatusByCategoryIDStatusIDandUserType(int IssueeCategoryID, int IssueStatusID, int UserType)
{
List<IssueStatus> issueStatusList = new List<IssueStatus>();
}
</code></pre>
<p>Can anyone help me on this.</p>
<p>Thanks,
Mahesh</p>
| c# asp.net | [0, 9] |
3,556,862 | 3,556,863 | Changing Button's Text Dynamically | <p>I had already setup the buttons and the layout properly, but I'm having an issue to dynamically change the text in the buttons</p>
<p>|B|P|M|F|</p>
<p>When the letter b is clicked: change b to e, f, g and each change of letter stops for 1 second
When the letter p is clicked: change p to q, r, s and each change of letter stops for 2 second
and so on. </p>
<p>I searched Google, and many results show that I need some sort of threading to accomplish it. Can anyone point me to the right direction?</p>
<p>Thanks</p>
<p>Sorry if I wasn't clear enough. My exact problem is to change the text when the user has touched on a button 4 times that pauses each changed text for 1 to 2 seconds not exactly. This is part of the source code</p>
<pre><code>public class someClass extends Activity implements OnClickListener
{
//Single Vowels
Button a_button;
MediaPlayer mp = new MediaPlayer();
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MediaPlayer.OnCompletionListener completionListener = new MediaPlayer.OnCompletionListener()
{
public void onCompletion(MediaPlayer mediaP)
{
mediaP.stop();
mediaP.release();
}
};
mp.setOnCompletionListener(completionListener);
a_button = (Button)findViewById(R.id.a_button);
a_button.setOnClickListener(this);
}
public void onClick(View v)
{
switch(v.getId())
{
case R.id.a_button:
mp = MediaPlayer.create(this, R.raw.a_multiple);
mp.start();
break;
}
}
}
</code></pre>
<p>So what I want to do is when the user pressed the button, there would be some sort of speech, for example, this is an apple, and the text will change accordingly with the speech. The speech is pre-recorded, and all I have to do is to trial and error and match the speech with the changing words. In total I have about 10+ buttons that does the same thing.</p>
| java android | [1, 4] |
3,145 | 3,146 | Uncaught TypeError: Property '$' of object [object Window] | <p>I've been working on a site recently that is now coming up with jQuery errors!
It has been behaving fine until recently when I have noticed these errors in chromes console. These seem to be coming up within the google hosted jQuery. I've tried using previous versions of jQuery as well but it keeps showing the errors.</p>
<p>It's online at <a href="https://www.upsandgeneratorparts.com/auction/" rel="nofollow">https://www.upsandgeneratorparts.com/auction/</a></p>
<p>the header file is <a href="http://pastebin.com/PiKigvhg" rel="nofollow">http://pastebin.com/PiKigvhg</a></p>
<p>This is the error that is showing:</p>
<pre><code>Uncaught TypeError: Property '$' of object [object Window] is not a function
(anonymous function)
e.extend.globalEval jquery-1.7.2.min.js:2
e.extend.globalEval jquery-1.7.2.min.js:2
f.fn.extend.domManip jquery-1.7.2.min.js:4
e.extend.each jquery-1.7.2.min.js:2
f.fn.extend.domManip jquery-1.7.2.min.js:4
f.fn.extend.append jquery-1.7.2.min.js:3
f.fn.extend.html jquery-1.7.2.min.js:4
e.extend.access jquery-1.7.2.min.js:2
f.fn.extend.html jquery-1.7.2.min.js:4
f.fn.extend.load.f.ajax.complete jquery-1.7.2.min.js:4
f.Callbacks.o jquery-1.7.2.min.js:2
f.Callbacks.p.fireWith jquery-1.7.2.min.js:2
w jquery-1.7.2.min.js:4
f.support.ajax.f.ajaxTransport.send.d jquery-1.7.2.min.js:4
</code></pre>
<p>Is there a way of using noconflict to sort this or another handy function or am i just missing something out completely!</p>
<p>Oliver</p>
| javascript jquery | [3, 5] |
4,677,691 | 4,677,692 | Regular Expression for integer string | <p>I need to check the following integer input sequences:</p>
<ul>
<li>23 = true</li>
<li>23,50 = true</li>
<li><p>50-100 = true</p></li>
<li><p>34,,90 = false</p></li>
<li>34,-90 = false</li>
<li>34--90 = false</li>
</ul>
<p>how can i check it in c#</p>
| c# asp.net | [0, 9] |
4,414,739 | 4,414,740 | check for at least 2 char sequence before whitespace in javascript / jQuery | <p>Well like the title says, how can i check it?
i have started something like this:</p>
<pre><code> for (var i = 0; i < elm.val().length; i++) {
if (elmVal.charAt(i) !== '') {
//do something
}
}
</code></pre>
<p>For example:</p>
<p>if the string is: "g g g" OR "gg g " it should be illegal.</p>
| javascript jquery | [3, 5] |
2,717,718 | 2,717,719 | Radiobutton selection problem in update panel | <p>I have a gridview inside an updatepanel. It has a TemplateField column with radiobutton:</p>
<pre><code><asp:GridView ID="gridView_stLists" runat="server" AutoGenerateColumns="False" CellPadding="3"
BorderStyle="NotSet" CssClass="table_layout" Width="500">
<RowStyle CssClass="table_body" />
<Columns>
<asp:TemplateField HeaderStyle-Width="20">
<ItemTemplate>
<asp:RadioButton ID="rdBtn_stdl" runat="server"
oncheckedchanged="rdBtn_stdl_CheckedChanged" AutoPostBack="True"
GroupName="stdl" value='<%# Eval("uri") %>'/>
</ItemTemplate>
<HeaderStyle Width="20px" />
</asp:TemplateField>
</code></pre>
<p>And i have the eventhandler for CheckedChanged.
<strong>My problem is</strong>, firstly, with autopostback true, when I select radio in grid, selection disapears. Secondly, with autopostback true or false, the eventhandler is not fired. Could you please help in this situation</p>
| c# asp.net | [0, 9] |
135,731 | 135,732 | Given a textarea generated from asp:textbox, the inner text cannot be 'set' with Javascript or Jquery | <p>I have a single asp:textbox declared as follows:</p>
<pre><code><asp:TextBox ID="textBox1" class="myTB" runat="server" TextMode="MultiLine"
Font-Names="Calibri" Font-Size="Small" Font-Bold="True" Height="175px"
Width="725px" BorderColor="#76B900" BorderStyle="Solid" BorderWidth="2px"
Style="overflow: hidden; margin: 5px;"></asp:TextBox>
</code></pre>
<p>Rendered it looks like this:</p>
<pre><code><textarea name="ctl00$ctl00$ctl00$AllContent$MainContent$MainContent$textBox1"
class="myTB"
id="ctl00_ctl00_ctl00_AllContent_MainContent_MainContent_textBox1"
style="border-bottom: #76b900 2px solid; border-left: #76b900 2px solid;
margin: 5px; width: 725px; font-family: Calibri; height: 175px;
font-size: small; overflow: hidden; border-top: #76b900 2px solid;
font-weight: bold; border-right: #76b900 2px solid;"
rows="2" cols="20"></textarea>
</code></pre>
<p>I have tried the following JQuery and JS respectively and in either case, the content of the text-area never changes even though the value does when I look at it with the debugger</p>
<pre><code>function generateQuery() {
var textBox = $(".myTB");
textBox.value = "jquery woohoo";
}
</code></pre>
<p>AND</p>
<pre><code>function _generateQuery() {
var textBox = document.getElementsByTagName("textarea");
textBox.value =" work for crying out loud ";
}
</code></pre>
<p>And yes, it's the only textbox of that class on my page.</p>
| asp.net javascript jquery | [9, 3, 5] |
671,971 | 671,972 | Is it possible to disable c++ assert from .net app | <p>I have the following problem:
I use c++ library from my WPF app, the library throws an assertion in some very rare cases. It shows a nice dialog with c++ filename, the line number and assert expression. So the question is: can I disable asserts in the c++ library assuming that I don't have source code. What I really need is to "catch" this assertion and log it.</p>
<p>Thanks.</p>
| c# c++ | [0, 6] |
12,464 | 12,465 | android: start in symbol keyboard mode, but don't restrict to numbers-only input | <p>I want to specify that Android should start the soft keyboard for a given EditText in the numeric/symbols mode. I know this can be done by setting the input type of the EditText to be numeric using EditText.setInputType() except that I do not want to restrict the input type for the EditText to numeric input only**. Is there another way to tell Android what keyboard it should open for a given EditText?</p>
<p>** I want essentially a Math class of numeric input, accepting arbitrary mathematical expressions, including [0,9.+-/*()@:].</p>
| java android | [1, 4] |
2,218,355 | 2,218,356 | gridview questions | <p>I have a gridview layout. I also have some images that i will be putting in the gridview as imageviews. I want to pick and choose which images will go in what row. That is I may have 5 images go to row 1 and 5 images may go to the row at end of the screen while all the rows in between are blank. Unfortunately right now it only inserts pictures row by row, and you can't pick and choose what row you want to add it to. Is what I'm trying to do feasible in gridview? </p>
| java android | [1, 4] |
441,301 | 441,302 | How to prefill a form with post data in ASP.NET | <p>I need to populate a form in the main page which on being submitted opens a lightbox which contains another form .</p>
<p>I was planning to submit the form using Post as that seems to be the only way I can define which iframe to open in the lightbox .However my question is that how do I pre-populate the second form with the first forms data when I use the submission as POST</p>
<p>I am using ASP.NET and C#</p>
<p>I apologize for the naive question but I am still playing around with ASP.NET </p>
| c# asp.net | [0, 9] |
893,630 | 893,631 | Javascript image height and other calculation | <p>I was having a problem on getting the height and also calculating other calculations.</p>
<p>I want to get the image height after it has loaded, so I put it on the onload attribute of <code><img></img></code> function, here's my code</p>
<pre><code><p class="test1" style="position:absolute;bottom:0px;">
<img src="'+getBaseURL()+'js/check/no-image.png" rel="fullname"
onload="verticalCenter()"/>
</p>
function verticalCenter(){
var imageHeight = jQuery(".test1 img").height(); //I get a result of 0
var total = imageHeight / 2 + 80
}
</code></pre>
<p>I already tried using setTimeout but it still fails.
What I was planning to do here is to set the css of <code><p class="test1"></code> into like this:</p>
<pre><code>jQuery(".test1").css("bottom","-"+total);
</code></pre>
<p>As I said, this isn't working because I don't get a result in total.</p>
<p>How would I do this, Is there a way to solve this problems, I'm already scratching my head on this.</p>
<p>Thanks in advance!</p>
| javascript jquery | [3, 5] |
1,597,789 | 1,597,790 | Databinding Table References | <p>I have two tables tblCarrier and <code>tblCustomer</code>. Both tables are <code>INNER JOIN</code> and have the same column name which is company name. The problem is when I use the databinding process </p>
<p><code><%#DataBinder.Eval(Container.DataItem, "CompanyName")%></code> to get the back the customer company name, it gives me back the carrier company name. What I notice from my query is that it gets back the company name based on the order sequence in the query statement.</p>
<p>For example</p>
<blockquote>
<p>"SELECT
tblCarrier.CarrierID,tblLoadMaster.Salesperson,tblLoadMaster.Status,
tblCarrier.CompanyName, tblCustomer.CompanyName"</p>
</blockquote>
<p>This T-SQL statement will bring back the carrier company name, but if I were to put the <code>tblCustomer.CompanyName</code> before <code>tblCarrier.CompanyName</code>, it will then bring back the customer company.</p>
<p>Is there way to databind the columns to get the results based on the cross reference table?</p>
| c# asp.net | [0, 9] |
1,137,019 | 1,137,020 | can users trigger javascript: function from URL? | <p>i have a function that calls javascript:del_release_comment(10,12); from the page, if the user has that particular comment.</p>
<p>I wonder if other users can trigger from the URL bar or somehow else this function to delete comments that aren't their.</p>
<p>10 is the news_id and 12 is the comment_news_id, the id of the comment on that particular news.</p>
<p>THe delete is done via AJAX calling a PHP script that does delete on these 2 parameters.
If the javascript function can be called by hand i'd have to re-enforce the little PHP script that deletes the comment. Also, is it possible to call that particular PHP script by name in the URL directly ? It uses _POST vars, not GET.</p>
<p>Thanks.</p>
<p>code for deleting the comment : </p>
<pre><code>$query_del_comment = "DELETE from myl_news_comments WHERE comment_id='".mysql_real_escape_string($_POST['comment_news_id'])."' AND news_id='".mysql_real_escape_string($_POST['news_id'])."'";
$result_del_comment = mysql_query($query_del_comment) or die('Query failed: ' . mysql_error());
</code></pre>
| php javascript | [2, 3] |
3,717,191 | 3,717,192 | Accesing Server Control from other webform | <p>I have 2 webforms with 1 ListBox Control on each of them.</p>
<p>How do I access the Listbox that's located on webformA from webformB?</p>
<p>For example I wish to declare something like this <code>string name = ListBoxWebformA.SelectedValue.ToString();</code> on WebFormB, so that I can work with that value in the code of WebFormB.</p>
<p>The ListBox on WebFormA lists several names.
When I select a name from the listbox and press the OK button I call <code>Response.Redirect("~/WebFormB.aspx")</code>;</p>
<p>So from WebFormB I wish to access this "name" by putting the selected value into a string.</p>
| c# asp.net | [0, 9] |
1,401,634 | 1,401,635 | Upgrading a piece of code from jQuery 1.3.2 to the latest version | <p>This code works in jQuery 1.3.2</p>
<pre><code> $(document).ready(function() {
$(function() {
$("#proiecte").click(function(e) {
e.preventDefault();
$("#ThisWillScroll").removeClass() .addClass("slide1");
$("#menu li a").removeClass(), $("#proiecte").addClass("active");
});
});
$(function() {
$("#desprenoi").click(function(e) {
e.preventDefault();
$("#ThisWillScroll").removeClass() .addClass("slide2"),
$("#menu li a").removeClass(), $("#desprenoi").addClass("active");
});
});
});
</code></pre>
<p>However when I replace the library with the latest version (1.6.2), it stops working. </p>
<p>I'm not very well versed in jQuery and have no clue what it could be inside my code that stops it from working. A deprecated function maybe ?</p>
<p>--</p>
<p>It has been solved.</p>
<p>I had a piece of forgotten code which messed up the script. </p>
<p>Thanks to <a href="http://stackoverflow.com/users/764846/genesis">genesis</a> for pointing out there's a JS console, I had no clue there was something like that (I mainly work in design).</p>
| javascript jquery | [3, 5] |
4,806,625 | 4,806,626 | jQuery Draggable / Droppable - Remove all dropped 'items' | <p>Is it possible to remove all dropped 'items' on a droppable div by pressing a single button?</p>
<p>Thanks,
LS</p>
<pre><code>$("#wrapper").droppable({
accept: '.shape',
drop: function(event, ui)
{
$(this).append($(ui.helper).clone());
$("#wrapper .shape").addClass("item");
$(".item").removeClass("ui-draggable shape");
$(".item").draggable({
containment: '#wrapper'
});
}
});
$("#trash").droppable({
accept: '.item',
drop: function(event, ui)
{
$(ui.draggable).remove();
}
});
</code></pre>
<p>I've created a div called trash, so when the items are dropped into this they are removed. I need similar functionality to this but when a button is pressed it removes all of the dropped shapes without having to drag them onto the trash div.</p>
| javascript jquery | [3, 5] |
2,889,568 | 2,889,569 | How do I get the position of individual characters rendered on user's browsers? (Jquery/javascript) | <pre><code><p> this is a very long text indeed. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
</code></pre>
<p>When I render the sample text on the web, the position of each characters change based on user's settings. (For example, the line divisions are different based on which browser the user is using, and how much is the page magnified - zoom in any webpage with lots of texts and you'll see this changes a lot)</p>
<p>But the application I'm trying to make has to get the position of individual characters to work.
So I need the position relative to the entire webpage and/or some other position (such as the position relative to the starting point of the paragraph.)</p>
<p>BTW, I prefer Jquery solution...but if you can't do it with Jquery, I'm OK with solutions using other libraries/tools</p>
<p>Thank you :)</p>
<p>p.s:sorry for my bad English... if you don't get the question, it's probably my fault.</p>
<hr>
<p>I got the idea of using the span tag and the .offset() - thank you for the quick solutions:)</p>
<p>But I wonder if there's another way than using the span tag...maybe somekind of empty tag that does nothing but contain a character or more...</p>
<p>Is this possible if I use CSS or some other stuff?</p>
<p>anyway, thank you again :)</p>
| javascript jquery | [3, 5] |
131,579 | 131,580 | jQuery - How many cells in a row | <p>Is there a way in jQuery to tell how many cells are in a selected row? For example, I am iterating through the rows via:</p>
<pre><code>$("#statsId > table tbody tr").each ( function() {
var secondCol = $(this).find('td:nth-child(2)').html();
var thirdCol= $(this).find('td:nth-child(3)').text();
</code></pre>
<p>and want to retrieve the second and third cell values. However when I do this iteration the cell values are coming back null when I know they are not. I thought if there was a way to verify the number of cells/columns in the selected row, I could at least verify that there are three cells in the selector. Or perhaps my selector for "secondCol" and "thirdCol" is wrong. Any help is appreciated.</p>
| javascript jquery | [3, 5] |
4,809,259 | 4,809,260 | How to hide view source | <p>Could some one please help me out to hide a view source option of a web page in dot net ?</p>
| c# asp.net | [0, 9] |
1,687,866 | 1,687,867 | C# Passing a part of an array as an argument of a function by reference | <p>Is the C# code below the equivalent way of trying to achieve the same as the C++ code?
Is there any way to avoid the copy (while not sending the whole array to the function)?</p>
<p>C++</p>
<pre><code>static void somefunction(double* v, int nb)
{
//something that will update v[0],v[1], ... v[nb-1]
}
double * myarray=new double[100];
somefunction(&myarray[10],5);
//...
delete [] myarray;
</code></pre>
<p>C#</p>
<pre><code>static void somefunction(double[] v, int nb)
{
//something that will update v[0],v[1], ... v[nb-1]
}
double[] myarray=new double[100];
double[] temp_array=new double[5];
somefunction(temp_array,5);
temp_array.CopyTo(myarray,10);
</code></pre>
| c# c++ | [0, 6] |
4,521,814 | 4,521,815 | Getting cell value from table in jQuery | <p>I have a table with no id or name inside of a div. How do I read the value from the desired table cell in jQuery? For example:</p>
<pre><code><div id="myDiv" style="padding-top: 0px; height: 60px;">
<table width="264" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td width="80" height="20" style="font-size: 10px;">
</td>
<td id="the_cell_i_want" align="right" style="color: rgb(102, 188, 41); font-size: 24px;font-weight: bold; background-color: rgb(255, 255, 255); background-image: none;">THE_VALUE_I_WANT</td>
</tr>
<tr>
</tr>
<tr>
</tr>
</tbody>
</table>
</div>
</code></pre>
<p>I want to retrieve the cell with the id "the_cell_i_want" and it should return "THE_VALUE_I_WANT".</p>
| javascript jquery | [3, 5] |
794,351 | 794,352 | Working with jQuery wrap function | <p>I am trying to wrap an input element with a div, and then append another element to the wrapping div.</p>
<p>Markup:</p>
<pre><code><div>
<input type="text" id="foo" />
</div>
</code></pre>
<p>JS:</p>
<pre><code>var wrapper = $('<div class="wrapper"></div>'),
somethingElse = $('<div class="something-else"></div>');
$('#foo').wrap(wrapper);
wrapper.append(somethingElse);
</code></pre>
<p>JSFiddle: <a href="http://jsfiddle.net/ckpeZ/" rel="nofollow">http://jsfiddle.net/ckpeZ/</a></p>
<p>The problem is the "somethingElse" div is not getting appended to wrapper. It is like the line <code>wrapper.append(somethingElse)</code> is completely ignored. What am I doing wrong?</p>
| javascript jquery | [3, 5] |
2,904,272 | 2,904,273 | How can i add mp3 to multimedia player on Android? | <p>How can i run multimedia scanner in android? My application download files to SDCARD/Music , but when i run the standard music player, i can't found new mp3. When I restart my phone, music player see my new mp3.</p>
| java android | [1, 4] |
636,695 | 636,696 | jQuery iterate through HTML in a variable and remove first radio button | <p>I have a some HTML stored in a javascript variable that looks like below. Example looks like below.</p>
<pre><code>var divHTML = "<table><tbody><tr><td><input type='radio' name='radio_1'></td></tr><tr><td></td><tr><td><input type='radio' name='radio_2'></td></tr></tbody></table>;
</code></pre>
<p>I would like to iterate through the <code>divHTML</code> and remove the first radio button along with the <code><tr></tr></code> that wrapped around it and return the rest of the HTML. (could acheive the same by removing the first <code><tr></tr></code> as well I think - as it will remove what's inside but the end goal is to not see the first radio button).</p>
<p>Also created a JSFiddle with the string in place. <a href="http://jsfiddle.net/chin/ZDwTd/" rel="nofollow">jsFiddle</a> Please help. Hope the question is clear and many thanks in advance. </p>
| javascript jquery | [3, 5] |
1,613,721 | 1,613,722 | Develop an E-book Reader | <p>I know this question is very broad , but i just need guidance on how to start off. Okay , here is what i'am trying to do :</p>
<p><strong>I want to develop an E-book reader on my website.</strong>
Details : i want a horizontal layout , only 2 pages are visible and then i click the next button so the next 2 pages should appear (hope this makes sense).</p>
<p><strong>I dont want to use an open source on because</strong> i want to add alot of future enhancements to the e-book reader like the ability to mark/highlight text , add sticky notes kind of stuff , etc ,etc . I really want to build this on my own</p>
<p><strong>Technologies</strong> : Javascript, Jquery, BackboneJS , underscoreJS,requireJS,PHP(no flash , any of these will be able to manage)</p>
<p>Iam <strong>not looking for the entire code</strong> how to develop the e-reader, just a few tips on how to go about it and some guideline how to make it.Any tutorials , anything helpful , please please do help.</p>
<p>Thank you.</p>
| php javascript jquery | [2, 3, 5] |
1,658,041 | 1,658,042 | PHP Populate Text box from Select - Array fields | <p>I need to populate the relevant text box with the results of a Select drop down.</p>
<p>My Javascript so far is </p>
<pre><code><script language="JavaScript">
var mytextbox = document.getElementById('error');
var mydropdown = document.getElementById('errormsg_id');
mydropdown.onchange = function(){
mytextbox.value = this.value;
}
</script>
</code></pre>
<p>My select box and text boxes are built as arrays from a query so there is nultiple of them.
I need to be able to populate the corresponding text box with the results from the Select next to it. </p>
<p>Any ideas?</p>
<p>Thanks</p>
<pre><code> <td width="1%">
<select style="width:100%" name="errormsg_id[]" id="errormsg_id[]">
<?php do { ?>
<option value="<?php echo $row_rserrormsg['errormsg_id']?>"
<?php if ($row_rsdates['errormsg_id'] == $row_rserrormsg['errormsg_id']) { echo("selected='selected'"); } ; ?> >
<?php echo $row_rserrormsg['error_message']?></option>
<?php } while ($row_rserrormsg = mysql_fetch_assoc($rserrormsg)); ?>
<?php mysql_data_seek($rserrormsg, 0);
$row_rserrormsg = mysql_fetch_assoc($rserrormsg);?>
</select>
</td>
<TD align="center" class="adminuser">
<input style="width:96%;text-align:left;" autocomplete="on" title="Enter Error Message" type="text" name="error[]" id="error[]" value="<?php echo $row_rsdates['error_message']; ?>" maxlength="100"/>
</TD>
</code></pre>
| php javascript | [2, 3] |
3,579,447 | 3,579,448 | 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><script language='javascript' type='text/javascript'>
function Save()
{
GetInputControl('hdnTimeOut').value = '2';
var btnObj = GetInputControl("btnSave");
alert (btnObj );
btnObj.click();
// document.aspnetForm.submit();
}
window.onbeforeunload = function (e)
{
if (saveOnUnload) Save();
};
</script>
</code></pre>
| c# javascript | [0, 3] |
98,381 | 98,382 | Filtering a string list with logic? | <p>I have a list of strings. I need to be able to filter them in a similar way to a Google query.</p>
<p>Ex: <code>NOT water OR (ice AND "fruit juice")</code></p>
<p>Meaning return strings that do not have the word water or return strings that can have water if they have ice and "fruit juice".</p>
<p>Is there a mechanism in .NET that can allow the user to write queries in this form (say in a textbox) and given a List or IEnumerable of string, return the ones that contain this.</p>
<p>Can LINQ maybe do something like this?</p>
<p>I am aware that I can do this with LINQ, I'm more concerned with parsing an arbitrary string into an executable expression.</p>
| c# asp.net | [0, 9] |
1,610,211 | 1,610,212 | how to show confirmation dialog from drop down list? | <p>i have a grid which display data from database, and i have a custom column in the left side with checkbox, i choose records to be deleted and i have a dropdown list, which will trigger an event in server side to delete records, before i delete those records i want to show a confirmation dialog like "are you sure? with ok and cancel", how to do that? any thought?</p>
<p>i do this :</p>
<pre><code> if(ddlAction.SelectedValue == "Delete")
{
string id = string.Empty;
int i = 0;
List<int> idx = new List<int>();
foreach (GridViewRow rowitem in gvDept.Rows)
{
CheckBox itemchk = (CheckBox)rowitem.FindControl("cbSelectOne");
if (itemchk != null & itemchk.Checked)
{
id += rowitem.Cells[3].Text.ToString() + ',';
idx.Add(i);
}
i = i + 1;
}
id = id.Trim(",".ToCharArray());
List<string> objRemoveKeys = id.Split(',').ToList();
if (objRemoveKeys.Count > 0)
{
ddlAction.Attributes.Add("OnChange", "javascript:return confirmDeletion('Are you sure you would like to remove the selected items?');"); // this part not working.
AirAsiaLinqDataContext LinqDataCtx = new AirAsiaLinqDataContext();
var record = from a in LinqDataCtx.departements
where objRemoveKeys.Contains(a.departementcode)
select a;
LinqDataCtx.departements.DeleteAllOnSubmit(record);
LinqDataCtx.SubmitChanges();
for (int j = 0; j < idx.Count; j++)
{
gvDept.DeleteRow(idx[j]);
}
}
ddlAction.SelectedValue = "";
</code></pre>
<p>}</p>
| c# asp.net | [0, 9] |
2,396,990 | 2,396,991 | C#: Bypass non-serializable properties when going about serialization | <p>I follow the code snippet to calculate Session size.</p>
<p><a href="http://stackoverflow.com/questions/1668989/profile-memory-usage-of-session-state-asp-net">Profile Memory Usage of Session State ASP.Net</a></p>
<p>My problem is some properties of objects <strong>aren't marked as Serializable</strong> so I cannot apply the solution. </p>
<p>Can I just <strong>bypass</strong> non-serializable properties? </p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
4,298,026 | 4,298,027 | Creating a C# object in javascript | <p>I'm trying to submit data to a web service in my project. The data's in the form of several fields, so I'd rather create a single object and submit that. I know I can submit it as a JSON object, but I thought I'd seen code somewhere that would create a C# object on the JS side so that I could submit it to the web service.</p>
<p>Am I crazy, or what does this JS code look like?</p>
<p>Just to get everyone on the same page example-wise, let's say the C# class would look like this:</p>
<pre><code>namespace NSTest
{
[Serializable]
public class ClassTest
{
public string ClassName;
public int ClassValue;
}
}
</code></pre>
<p>And the web service would look like this:</p>
<pre><code>namespace NSTest
{
public class WebServiceTest
{
[WebMethod]
public void WSFunc(ClassTest test)
{
...
}
}
}
</code></pre>
| c# javascript | [0, 3] |
2,887,870 | 2,887,871 | Bind a jquery function to elements | <p>I am very new to jquery and need some help. I am trying to change a css element when I enter a textbox. I have applied a css class to my textboxes and I have a couple of div tags around my textboxes.</p>
<p>When a user selects the textbox I want to change the desired div tag.</p>
<p>This is how the html looks</p>
<pre><code><div class="left">
<div class="right">
<input name="myTextBoxID" type="text" id="myTextBoxID" class="myTextBox" />
<span id="rfInput"></span>
</div>
</div>
</code></pre>
<p>my jquery looks like this</p>
<pre><code><script language="javascript" type="text/javascript">
$(function () {
$('.myTextBox').focus(function () {
$('.box.left').addClass("active");
}).blur(function () {
$('.box.left').removeClass("active");
});
});
</script>
</code></pre>
<p>Now the jquery is working and changes the class on focus and blur however it effects all elements witht he class="myTextBox" how can I get jquery to attach to all elements however only fire the css change to the selected textboxes outside elements class?</p>
<p>Any help would be great!</p>
| javascript jquery | [3, 5] |
4,195,050 | 4,195,051 | how to increment between a range of dates using javascript | <p>I need to increment between a range of dates using javascript. I have start_date and end_date in the following format.</p>
<pre><code>var start_date = Fri Nov 09 2012
var end_date = Thu Nov 15 2012
</code></pre>
<p>I need to call a function which accepts all the dates by looping between start dates and end dates as parameter. Something like this</p>
<pre><code>for (date = start_date; date < end_date; date++) {
getCellFromDate(date, calInstance);
}
</code></pre>
<p>I need to provide the parameters to getCellFromDate in the same date format(Fri Nov 09 2012) . How do I achieve this..I am new to javascript.. Please help</p>
| javascript jquery | [3, 5] |
3,740,929 | 3,740,930 | Assign entire file to a var as a string using jquery | <p>I'm trying to assign the contents of an xml file to a var, like so:</p>
<pre><code>var testing = $.load('xx.xml');
$('#display').text(testing);
</code></pre>
<p>but it's not working. I tried the ".load" function as suggested in:</p>
<p><a href="http://stackoverflow.com/questions/3875833/how-to-assign-file-contents-into-a-javascript-var">How to assign file contents into a Javascript var</a> </p>
<p>and I had a look at the page they suggest form the jquery website, but I can't find something specific to assigning the contents of the .xml file to the var as a string.</p>
<p>I appreciate this is probably very obvious & I am arguably being lazy, but I have been trying random things for a while & cannot figure this out.</p>
<p>Thanks</p>
<p>EDIT! I was loading up the contents inside the load function, i didn't mean this, it's now edited.</p>
| javascript jquery | [3, 5] |
3,396,980 | 3,396,981 | Hide button after last class has been shown | <p>I have the following, </p>
<pre><code>$("#slider1next").click(function () {
$(".text:visible").next().show();
});
</code></pre>
<p>When the last class (.text) has been shown i want to hide #slider1next how would i go about this? </p>
<p><a href="http://jsfiddle.net/ma9ic/U2UZ4/3/" rel="nofollow">http://jsfiddle.net/ma9ic/U2UZ4/3/</a></p>
| javascript jquery | [3, 5] |
3,013,895 | 3,013,896 | jQuery validation and check all together | <p>I make a jquery validation, problem is here that this part from code first(first click on button) check selectbox and second(second click on button) fields. how can it fix as that check all together with one click on button?</p>
<p><strong>Exampel(see full code):</strong> <a href="http://jsfiddle.net/JfPaN/" rel="nofollow">http://jsfiddle.net/JfPaN/</a></p>
<pre><code>$('.submit').submit(function () {
if (required_selectbox() == false || required_valid() == false) {
return false;
}
});
</code></pre>
| javascript jquery | [3, 5] |
3,740,549 | 3,740,550 | JS/jQuery/PHP: trying to generate an URL using PHP variables | <p>i'm generating this code</p>
<pre><code>$.ajax({
url: '/orders/modify/action/',
type: "POST",
dataType: 'json',
data: 'id='+10+
'&commento='+$('#shop_order_status_history_comments').val()+
'&id_status='+$('#shop_order_status_history_orders_status_id').val()+
'&notify_client='+$('#shop_order_status_history_notify_client').val()+
'&local_part_email='+j.garpe+ // the error goes here
'&domain_email='+domain.com,
success:function(data){
</code></pre>
<p>But I'm getting this error: </p>
<blockquote>
<p>"Uncaught referenceError: j is not
defined".</p>
</blockquote>
<p>The code is this:</p>
<pre><code> ...
'&local_part_email='+<?php echo $local_part_email?>+
...
</code></pre>
<p>Any help?</p>
<p>Regards</p>
<p>Javi</p>
| php javascript jquery | [2, 3, 5] |
3,666,409 | 3,666,410 | A dropdown validation error occurs if no value is selected on the associated radio button | <p>I have a form with two radio buttons: "Yes" and "No". If "Yes" is selected, the user selects what they want from two drop-down menus. If the user selects "No", the form's JavaScript will grey out both drop-down menus.</p>
<p>My jQuery code is shown below. I added:</p>
<pre><code>if(!$("#discount").prop("disabled") && $("#colour1, #shade1").val() == 'please select'){
//alert('Please select');
}
</code></pre>
<p>but it did not work.</p>
<p>Both radio buttons' <code>name</code> attribute is set to <code>discount</code>. The drop-down menus' <code>id</code> attributes are <code>#colour1</code> and <code>#shade1</code>.</p>
<p>The first value of each drop down is "please select":</p>
<pre><code> $( function(){
$("input[name='discount']").click(function() {
$("#colour1, #shade1")
.prop("disabled", this.value == 'No');
if(!$("#discount").prop("disabled") && $("#colour1, #shade1").val() == 'please select'){ //alert('Please select'); }.
}).click();
});
</code></pre>
| javascript jquery | [3, 5] |
2,146,631 | 2,146,632 | Passing JavaScript objects with c# | <p>I have a form on my website which collects data and posts using jquery to be handled using c#. I use request.form to capture the form data.</p>
<p>My friend said to create a JavaScript object to pass the data through instead of loads of variables. My problem is when you post an object with value pairs how do you get c# to obtain the values from the object because I can't seem to use request.form now.</p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
4,690,601 | 4,690,602 | JQuery Validation Problem | <p>I doing a field validation using jquery to check if it is empty. If it is I want to display a message and then refocus on the field so the user can enter some data. Code:</p>
<pre><code>
$('#fieldId').blur(function() {
var fieldValue = $(this).val();
if(fieldValue == null || fieldValue.length == 0) {
$(this).addClass('error');
// show error message
$('#errorDivId')
.text('You must enter a value in this field')
.show();
$(this).focus();
}
else {
if ($(this).is('.error')) {
$(this.removeClass('error');
$('#errorDivId').hide()
}
}
});
</code></pre>
<p>It sort of works but it moves the cursor to the next field and not the one I refocused on.</p>
| javascript jquery | [3, 5] |
6,003,476 | 6,003,477 | Android Python Programming | <p>Can I program for Android using Python? I seem to have stumbled upon many links while searching... however neither of them is concrete.</p>
<p>Any suggestions? I want to write apps for Android but really don't want to get into Java for all this.</p>
<p>PS: My question is whether I can write proper, full fledged apps for Android. </p>
| python android | [7, 4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.