If the user name and password does not match it displays a alert but if i click ok to the alert the form is logged in.Can any one tell me how to avoid it?Thanks.
<html>
<f:view>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h:form id="loginForm">
<h1><cen...
Hi,
I am using firebug for debugging etc.
When I deploy, it seems as though I have to remove all the console.log statements from my javascript code?
When viewing on a browser that doesn't have firebug I am getting errors relating to console...
...
In the code below. I expected true but i am getting false instead. What am I missing?
var text = "Sentence $confirmationlink$ fooo";
alert(placeHolderExists(text,'confirmationlink'); // alerts false
function placeHolderExists(text,placeholdername) {
var pattern = new RegExp('\$'+placeholdername+'\$');
return pattern.te...
I would like do do the following in Javascript (pseudo code):
myString.replace(/mypattern/g, f(currentMatch));
that is, replace string isn't fixed, but function of current match.
...
Does anybody know how to move the cursor in a textbox to a particular position?
For example if a textbox (e.g. input element, not textarea) has 50 characters in it and I want to position the cursor before character 20, how woould i go about it?
Jon
...
How would one create a deterministic Javascript HTML colour picker which given arguments of how many colours are desired returns an array of HTML hex colour codes, ie:
function createColours(numColours) {
return [/* colours array of size numColours */]
}
The colours themselves can be chosen / generated randomly, but the method m...
I have code that renders the following HTML
<tr>
<td>Control 1 with onclick="javascript:Test(this);" </td>
<td>Control 2</td>
<td><span><div>Control 3</div></span></td>
</tr>
function Test(myThis)
{
//Here I would like to get references to the siblings of Control 1 (in this ex: Control 2, Control 3)
//and disable them. Any id...
Can anybody help me, please ?
(sorry for my english, I'm french)
I've a combobox and i want insert an item "add-item" before read an array of data that populate my combobox. To sum-up :
1- Adding to my combobox "add-item" (add before read the array),
2- Adding to my combobox data from my array (it's ok for this part).
Here my code :
...
Right now I have a page where unfortunately there is a mix of update panels and calls to webservice web/script methods from javascript.
I have an update progress control which shows a spinner for update panel activity. But when I do webservice calls it isn't displayed.
How would you recommend I solve this usability issue since the use...
I'd like my GreaseMonkey script to run a function whenever elements with a specific class are inserted into a page. What's the most idiomatic way of doing that?
If it helps, it's a <select> element that is being inserted.
...
that's it, that's my question.
thanks!
-Morgan
...
Hi,
A website returns the following JSON response, how would I consume it (in javascript)?
[{"ID1":9996,"ID2":22}]
Is JSON simply returning an array?
...
Hi,
I have a <div>...</div> section in my HTML that is basically like a toolbar.
Is there a way I could force that section to the bottom of the web page (the document, not the viewport) and center it?
...
When I set a value of a text node with
node.nodeValue="string with &#xxxx; sort of characters"
ampersand gets escaped. Is there an easy way to do this?
...
Google maps is an impressive display of what you can do with javascript and Ajaxy-goodness. Even my mouse scroll wheel and right-click works to provide specific functionality.
In the standard HTML spec, I don't see an "onmouserightclick" event or similar basic javascript handling for the mouse wheel. Maybe I am looking in the wrong pl...
I have this loaded before the radio buttons with corresponding color variable.
<script type="text/javascript">
//<![CDATA[
images = {"Black":"http:\/\/ecx.images-amazon.com\/images\/I\/31XwBA2m8pL.jpg","Slate":"http:\/\/ecx.images-amazon.com\/images\/I\/31SqWkrSb6L.jpg","White":"http:\/\/ecx.images-amazon.com\/images\/I\/31OJufgJT2L.j...
Hi,
I can't find that tool that minifies that javascript.
Its a java based tool.
I thought douglas crawford made it, but can't find it on his site even!
...
I've seen many javascript objects that have a 'init' method that you pass in values to in order to setup the object.
How do they internally handle the initializations of their private variables when passed in a array of name/value pairs like:
myObject.init(
{prop1: "blah", prop2: "asdf", ..., propn: "n"}
);
Specifically, some ...
I've got an XML file that contains a list of questions. I'd like to load the first question in the list when an HTML page loads and load the answers as radio buttons. When one of the radio buttons is selected, I'd like to display the results as well as a continue button. The continue button would go to the second element in the XML file....
I'm looking for a very basic survey/wizard example using jQuery and HTML. I'd like it to connect to a text file or XML file and be independent of SQL, PHP, ASP.NET, or any other scripting language outside of JavaScript.
TIA
UPDATE: I'm looking for a solution that will ask a single question at a time. Then, based on the multiple choice ...