Is there a case insensitive version of the :contains jQuery selector or should I do the work manually by looping over all elements and comparing their .text() to my string?
When I try to run my code on any other webbrowsers apart from the Internet explorer it works fine. But when I try to run the code on Internet explorer I do get an alert box saying HERE along with an Ok button. but the problem is when I click on that OK button I do not get anything. Ideally I should be getting another alert box.
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#submit").click(function(event) {
alert("here");
$.post('process.php', {name:'test1',email:'test.com'}, function(data)
{
$('#results').html(data);
alert(data);
});
});
});
</script>
</head>
<body>
<form name="myform" id="myform" action="" method="POST">
<label for="name" id="name_label">Name</label>
<input type="text" name="name" id="name" size="30" value=""/>
<br>
<label for="email" id="email_label">Email</label>
<input type="text" name="email" id="email" size="30" value=""/>
<br>
<input type="button" name="submit" id="submit" value="Submit">
</form>
<div id="results"><div>
</body>
</html>
Any help on this is very much appreciated.
Edit: I found out that Internet Explorer which has HTTP works perfectly fine but not on Internet Explorer which uses HTTPS.
index.php
<html>
<head>
<title>Josh's Online Playground</title>
</head>
<body>
<form method="POST" action="action.php">
<table>
<tr>
<td>"data for stuff"</td>
<td><input type="text" ?></td>
</tr>
<tr>
<td><input type="submit"></td>
</tr>
</table>
</form>
</body>
</html>
action.php
<?php
error_reporting(E_ALL);
ini_sit("display_errors", 1);
$mysqli = new mysqli('localhost', 'root', 'password', 'website');
$result = $mysqli->query("insert into stuff (data) values ('
.$_POST['data']
."');
echo $mysqli->error();
if($result = $mysqli->query("select data from stuff")){
echo 'There are '.$result->num_rows.' results.';
}
while ($row = $result->fetch_object()){
echo 'stuff' . $row->data;
}
?>
Despite the first two lines in action.php, I get no error or warning messages.
Instead I get a blank page after clicking the submit button.
Do I have to do something differently to insert data?
Given the following javascript (jquery)
$("#username").keyup(function () {
selected.username = $("#username").val();
var url = selected.protocol +
(selected.prepend == true ? selected.username : selected.url) + "/" +
(selected.prepend == true ? selected.url : selected.username);
$("#identifier").val(url);
});
This code basically reads a textbox (username), and when it is typed into, it reconstructs the url that is being displayed in another textbox (identifier).
This works fine - there are no problems with its functionality. However it feels 'slow' and 'sluggish'. Is there a cleaner/faster way to accomplish this task?
Here is the HTML as requested.
<fieldset class="identifier delta">
<form action="/authenticate/openid" method="post" target="_top" >
<input type="text" class="openid" id="identifier" name="identifier" readonly="readonly" />
<input type='text' id='username' name='username' class="left" style='display: none;'/>
<input type="submit" value="Login" style="height: 32px; padding-top: 1px; margin-right: 0px;" class="login right" />
</form>
</fieldset>
The identifier textbox just has a value set based on the hyperlink anchor of a button.
I've finished the design and about to code HTML for a website that will use fancy formelements and effects.
I'm wondering if I should support IE6? What are the latest stats? Do you support IE6 still?
Hello, I'm creating an html page that is posted to another page for processing. I don't want users to see the weird URL they are redirected to and I was using FRAMES but I can't figure out how to add my HTML page dynamically because I need the variables and either add frames or try another way to accomplish this. So, based on how I'm creating the page below, how can I hide the URL and add something that I want.
Here is how I'm creating the page.
StringBuilder sb = new StringBuilder();
sb.Append("<html><head></head>");
sb.Append("<body onload=\"document.frmLaunch.submit();\">");
sb.Append("<form name=\"frmLaunch\" action=\"" + variableTargetURL + "\" method=\"post\">");
sb.Append("<input type=hidden name=\"testVariable\" value=\"" + variableTest + "\">");
sb.Append("</form>");
sb.Append("</body></html>");
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.Write(sb.ToString()); response.End();
Warm-up
I'm trying to come up with a good way to implement customized document forms.
It's for a tool to request access to applications; each application will want to ask its own specific questions. The thing is, we have one kind of (common) user who needs to fill in and submit documents based on templates, and another kind of (super) user who needs to be able to define what each template needs to contain.
One implementation option would be to use a form (with the basic mandatory stuff), and have that form dynamically include a subform appropriate to the specific task at hand. The gist of the matter is that we could (=will!) quite easily end up having many hundreds of different subforms!
(NB. These subforms will be maintained in an automated manner, but that is another topic that may be considered outside the scope of this Question.)
Question
It's common knowledge that having a lot of views in a Notes database is Bad Thing. But has anyone tried pushing the number of forms or subforms and made any experiences regarding performance?
Hi, I have a simple form interface set up that send username and password information to a server: (working)
NSString *postData = [NSString stringWithFormat:@"user=%@&pass=%@",[self urlEncodeValue:sysUsername],[self urlEncodeValue:password]];
NSLog(@"Post data -> %@", postData);
///
NSData* postVariables = [postData dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSMutableURLRequest* request = [[[NSMutableURLRequest alloc] init] autorelease];
NSString* postLength = [NSString stringWithFormat:@"%d", [postVariables length]];
NSURL* postUrl = [NSURL URLWithString:@"http://localhost/~csmith/cocoa/test.php"];
[request setURL:postUrl];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody: postVariables];
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:NULL error:NULL];
NSLog(@"Post data SENT & returned -> %@", returnData);
How do I handle connection errors such as no internet connection, firewall, etc.
Also, does this method use the system-wide proxy settings? Many of my users are behind a proxy.
Thanks a lot!
Hi,
I really like the idea of putting forms into a seperate class that manages validation etc, but I don't like everything ending up in a DL and also not being able to use square bracket notation in post elements like <input type='checkbox' name='data[]'>.
Is there another way of generating forms - like in views so I can style them the way I want, but also keeping the validation aspect? Also how would I load this view into my current view (using partial view somehow?)
Why Textarea and textfield not taking font-family and font-size from body?
See live example here http://jsbin.com/ucano4
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>texearea font</title>
<style type="text/css">
body {
font-family: Verdana, Geneva, sans-serif;
font-size:16px
}
</style>
</head>
<body>
<form action="" method="get">
<textarea name="" cols="20" rows="4"></textarea>
<input name="" type="text" />
</form>
<p>some text here</p>
</body>
</html>
If it's a usual behavior then should i write in css like this. i need same style in all
body,textarea,input {
font-family: Verdana, Geneva, sans-serif;
font-size:16px
}
And how many other elements in XHTML which will not take font styling from body {....}?
Is there a way to Specify a OneWay Binding in HandleBars? bind-attr always calls Ember.bind, which always create a two way binding. This seems to be the case for elements that don't even change:
<img {{bind-attr class=":class-name-to-always-apply"}}>
But even in cases where the element could change, we might have reasons to update it manually (e.g. performance or we don't want to change it on textChanged, but do it manually)
Hello, im using this function to hide some inputs from a form when a value selected in select tag.
this is the function:
function showEntry(obj,optionValue){
//hide all entry selections onchange
document.getElementById("group1").style.display="none";
document.getElementById("group2").style.display="none";
if(obj.value=="group1")
{
document.getElementById('group1').style.display="inline";
}
else if(obj.value=="group2")
{
document.getElementById('group2').style.display="inline";
}
}
and this is the form:
<select class="textinput" name="function_title" onchange="showEntry(this,this.value);">
<option value=""> </option>
<option value="group1" >group1</option>
<option value="group2" >group2</option>
</select>
<span id="group1" style="display:none;">
<input class="textinput" type="text" id="input1" name="input1" value="100"/>
<input class="textinput" type="text" id="input2" name="input2" value="50"/>
</span>
<span id="group2" style="display:none;">
<input class="textinput" type="text" id="input3" name="input3" value="60"/>
<input class="textinput" type="text" id="input4" name="input4" value="45"/>
</span>
All i want is to hide the hidden inputs value when this group of inputs are hidden.
Something like that:
<input class="textinput" type="text" id="input3" name="input3" value="if(obj.value!="group2") { print(60); }"/>
Is that right?
I have a rather simple C++ project, which uses boost::regex library. The output I'm getting is 3.5Mb in size. As I understand I'm statically linking all boost .CPP files, including all functions/methods. Maybe it's possible somehow to instruct my linker to use only necessary elements from boost, not all of them? Thanks.
I need to determine if I'm on a particular view. My use case is that I'd like to decorate navigation elements with an "on" class for the current view. Is there a built in way of doing this?
I am currently using find() and first() method to select the first descendent element from each of the <div> elements that contains the parent class. But I find this quite cumbersome since find() method would produce a set of matched elements before the first element is being picked. The following is the skeleton of my code:
HTML
<div class=parent>
<ul>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
</ul>
</div>
<div class=parent>
<ul>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
</ul>
</div>
<div class=non-parent>
<ul>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
</ul>
</div>
<div class=parent>
<ul>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
</ul>
</div>
// .....the list continues
Javascript
$('.parent').each(function() {
$(this).find('ul li').first().css('color', 'red');
// do other stuff within each loop
});
I have seen people using $(".parent li:first") selector. But, because I am doing it in a loop, I am not sure how or whether if this could be done and would like some advice. Thanks.
I don't now if this title is very clear, but I would like to understand how this is possible :
And how we can have 2 elements on the same row of the listview, and handle different clicks, as the listview deals with handling the click on a child.
Thanks for anyone who could point me in the right direction.
For example, input is
Array 1 = [2, 3, 4, 5]
Array 2 = [3, 2, 5, 4]
Minimum number of swaps needed are 2.
The swaps need not be with adjacent cells, any two elements can be swapped.
Hi, I want to send the username and password values which user types in html input elements to server to check if the username and password is valid or not when user click login button, using post request in $.ajax(options) method in jquery, but I don't know how to send those username and password to server. What option should I write in $.ajax(options) method to get those values from server?
hey there, I'm creating a series of input elements and for some reason their values aren't $_POSTing. Any light shed on the subject would be appreciated!
My current code is as follows:
javascript
Afields = 1;
function addAdultInput() {
if (Afields != 10) {
document.getElementById('adultMembers').innerHTML += "<input type='text' value='' name='adult_members_"+Afields+"' /><br />";
Afields += 1;
} else {
document.getElementById('adultMembers').innerHTML += "Only 10 Adult Member fields allowed.";
document.getElementById('addAdultMember').disabled=true;
}
}
HTML
<form name="form1" method="post" action="">
<tr>
<td class="style12" valign="top">Adult Members' Names:<br /><small>10 Max </small><input id="addAdultMember" type="button" onclick="addAdultInput()" name="add" value="Add Adult" /></td>
<td id="adultMembers">
<span class="erorr">*for paid members only</span><br />
<input type='text' value='' name='adult_members_0' /><br />
</td>
</tr>
<input type="submit" name="Submit" value="Register">
</form>
<form id="QandA" action="<?php echo htmlentities($action); ?>" method="post">
<table id="question">
<tr>
<td colspan="2">
<a onclick="return plusbutton();">
<img src="Images/plussign.jpg" width="30" height="30" alt="Look Up Previous Question" class="plusimage" id="mainPlusbutton" name="plusbuttonrow"/>
</a>
<span id="plussignmsg">(Click Plus Sign to look up Previous Questions)</span>
</td>
</tr>
</table>
</form>
In the code above I am able to replace an image with another image when the if statement is met. But my problem is that when the image is replaced, it does not disable the on click event. My question is that when the image is replaced, how do I disable the onclick event onclick="return plusbutton();?
I am going create a new xib which is very similar to an existing one. Instead on of crate an blank new one, copy UI elements and viewcontroller IOOutlets; is there a quick way to clone a xib with corresponding new viewcontroller class?
Thanks
I am going through one of my .R files and by cleaning it up a little bit I am trying to get more familiar with writing the code the r-ight way. As a beginner, one of my favorite starting points is to get rid of the for() loops and try to transform the expression into a functional programming form.
So here is the scenario:
I am assembling a bunch of data.frames into a list for later usage.
dataList <- list (dataA,
dataB,
dataC,
dataD,
dataE
)
Now I like to take a look at each data.frame's column names and substitute certain character strings. Eg I like to substitute each "foo" and "bar" with "baz". At the moment I am getting the job done with a for() loop which looks a bit awkward.
colnames(dataList[[1]])
[1] "foo" "code" "lp15" "bar" "lh15"
colnames(dataList[[2]])
[1] "a" "code" "lp50" "ls50" "foo"
matchVec <- c("foo", "bar")
for (i in seq(dataList)) {
for (j in seq(matchVec)) {
colnames (dataList[[i]])[grep(pattern=matchVec[j], x=colnames (dataList[[i]]))] <- c("baz")
}
}
Since I am working here with a list I thought about the lapply function. My attempts handling the job with the lapply function all seem to look alright but only at first sight. If I write
f <- function(i, xList) {
gsub(pattern=c("foo"), replacement=c("baz"), x=colnames(xList[[i]]))
}
lapply(seq(dataList), f, xList=dataList)
the last line prints out almost what I am looking for. However, if i take another look at the actual names of the data.frames in dataList:
lapply (dataList, colnames)
I see that no changes have been made to the initial character strings.
So how can I rewrite the for() loop and transform it into a functional programming form?
And how do I substitute both strings, "foo" and "bar", in an efficient way? Since the gsub() function takes as its pattern argument only a character vector of length one.
I have a ListActivity and I want to implement context menu for each of the list elements. I know that the common way to do this is to show the context menu on long click/tap. I want to know if there is a way to show the context menu for each element on a key press(preferably the menu key).
To rephrase my question, how can I trigger the context menu and not the options menu by pressing the menu key(or any other key).
I am attempting to automate the entry of data into form fields. The problem is that this data (user/pass) is not known by the user. I'm not expressly hiding it from them, but they also don't need to know it.
This is used to automate logins on several of our outside partner websites, who do not want our agents knowing their passwords. Sadly, most of these sites do not have any APIs I can work with... so I have to get the user logged in.
I tried using an iframe and javascript, but I ran into the issue of security permissions denying it access. And sadly, our clients do not have access to add our domain to their sites(they seem to be 3rd party).
Requirements:
- Display webpage
- Automatically enter data into fields
Would be nice:
- Automate signin similar to form.submit()
- Flash/AJAX support. These seem to give the VB app issues.
Is there a way to do this via javascript/html, and if not, do you have any recommendations for C#/php/asp.net options?
PS: I am not sure what this techinque is called, so google isn't helping me it seems. Please set me straight on the terminology of what I am actually trying to accomplish.
In ruby, how do I test that one array not only has the elements of another array, but contain them in that particular order?
correct_combination = [1, 2, 3, 4, 5]
[1, 5, 8, 2, 3, 4, 5].function_name(correct_combination) # => false
[8, 10, 1, 2, 3, 4, 5, 9].function_name(correct_combination) # => true
I tried using include, but that is used to test whether [1,2,3].include?(2) is true or not.