Hi
Is it possible to create a form that only displays if the user hasn't ever complted it?
Once it has been completed the form should never display again?
Thanks
The question is on the client side validation using java script.
Significant parts of the program related to the question are given below..
...
<form name="results" action="" method="post">
...
<input type="radio" name="id" value="<%= id_edit %>" /> <!-- Don't bother about id_edit -->
....
<input type="button" name="Edit" value="Edit" onclick="invoke(0)"><input type="button" name="Delete" value="Delete" onclick="return invoke(1)">
....
The script,
function invoke(btn)
{
if(btn == 0) document.results.action="gev.do";
if(btn == 1) document.results.action="del.do";
document.results.submit();
}
What basically i do is, depending on the selection of button, i pass a value to the servlet, either for updation or deletion.
My question is, how can i validate the radiobutton, ie, i can any one help me out writing the js to validate if any one of the radio button is selected.
All my efforts are in vein and i now use server side validation.
I'm referencing my js files before the closing body tag, hoping they will be parsed last (as they're not needed untill last). However when I analyse activity with PageSpeed in Firebug, the images seem to be requested last.
How can i make the images higher priority than the js?
It seems to work ok but I don't know if this can be impoved on or not.
I want to select any HTML tag that has a class of edit-text-NUM or edit-html-NUM and change the color of it. Here is what I am using...
jQuery(document).ready(function(){
jQuery('*')
.filter(function() {
return this.className.match(/edit-(text|html)-\d/);
})
.css({
'color': '#ff0000'
});
});
Does that look ok and is the regex ok?
*edit: Also is this efficient? I am aware that using jQuery('*') might be a bit of a hog if it's a large page. It only has to work from <body> down so maybe it could be changed?
hi,
I'm having this issue on my website in IE (6,7,8):
‘nodeType’ is null or not an object
The error refers to "f.nodeType" property. Basically f is undefined, so the issue is before, but I cannot fix it.
Could you give me some help ? www.donatellabernardi.ch/drupal
Thanks
I have a simple array like:
var myArr=["one","two","three"];
an I have a counting loop, which increases the value of var i by one.
What I want to do is print the next value from the array each time the loop runs, next to a text string, like so:
alert('value number '+myArr[i]+);
But for some reason I can't get this to work.
The following code works, so I'm assuming I'm not calling the counter right:
alert('value number '+myArr[0]+);
I have an Html page with an scroll ,and I'd like when the page starts (onload) to put the focus in the 60% parox (y axis) of the page. that means to scroll automatically the 60% of the page.
is this possible? thankyou
I recently filled out a form and when I got to the phone number textBox I noticed some really cool things going on. As I entered my number, general phone symbols were getting added automatically. Example:
I start entering my area code '555'
and my input was changed to 1 (555)
to test what just happened I backspaced on the ) and it quickly added it back in.
So my question is, how do I get this input to happen?
I have a href from that i am giving out a popup , and i want to activate this on my body overload . I am using "document.getElementbyId("myelement").click()" this is working fine in IE but FireFox is not supporting it. And i know that .click() will not be taken by firefox , but i dont have any other way to do it.
Can u please suggest me with a workaround that will be accepted by IE as well as FF.
Thanks in advance.
function test(custId){
List<Account> list=accountDelegate.findAccountEntityByGroupId((long)%>
custId<%)%>;
<script>
}
Here my question is how to send custId to java method as parameter from java script.where java method takes long argument.
Here's my HTML code:
<select class="grid_3 required jobData valid" id="clli" name="clli" style="font-size: 10px; border: none;">
<option value="0">Select One...</option>
<option value="905"></option>
<option value="931">0</option>
<option value="1">ABRDMSES</option>
</select>
<img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png">
<img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png">
<img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png">
<select class="grid_3 required jobData" id="job_status" name="job_status" style="font-size: 10px; border: none;">
<option value="0">Select One...</option>
</select>
When a $('#clli').change(); occurs, I slap a caution image next to it to warn the user that there are changes to be saved. However, if they make more than one change to the same element, I first want to see if there is already a caution image there before sending a new one. Any theories/methods on how to just scope out the next (but not $.next()) element?
Hi All.
When a user clicks a 'Add Node' button above a tree and the program adds a tree item below the selected node, I would like to insert the new tree item with the text highlight and ready for editing by the user... like labels in GMail. Any ideas?
--Kirt
I have a website that contains multiple pages as layers (not as separate HTML files).
I have three images:
<img src="image1.png" onclick="showlayer(1);return false;" />
<br />
<img src="image2.png" onclick="showlayer(2);return false;" />
<br />
<img src="image3.png" onclick="showlayer(3);return false;" />
When an image is clicked, it shows the relevant layer and hides the others.
I want it to also change the image to image1_active.png / image2_active.png / image3_active.png depending on which layer is visible (not via the onclick event handler).
Why not via the onclick event handler?...
Layer 1 is set as visible by default in the CSS, so image1 needs to be image1_active.png by default too - since the user has not had to click on anything yet, this is why I need the image switch to detect the layer's visibility/display to change the image.
The showlayer script is:
function showlayer(n){ for(i=1;i<=3;i++){document.getElementById("layer"+i).style.display="none";document.getElementById("layer"+n).style.display="block"; }}
Is it possible to adapt this script for this purpose?
thank you
Hi,
I'm creating a used cars website (written in PHP), and I'm stuck on sending advanced search options from form. I have more than 30 of them and I wonder if it's possible, and how, to send them in one variable (for example &options=1,2,3,5,6,10 or some other way..). Also I've heard that this is possible with "bitwise" but I don't have a clue how to do that. Or if someone have a better idea, please let me know.
Thanx
var page = 'data/appointments/<? echo $_SESSION['name']; ?><? echo $_SESSION['last']; ?>App.html';
var lM;
function checkModified(){
$.get(page, function(a,a,x){
var mod = x.getResponseHeader('last-modified');
alert (lM);
alert ("page" +mod);
});
}
when i alert the last-modified from my page, it outputs the same value, even when when i deleted all my cookies and cache , deleted the file from the server and replace it.
it still outputs one value
Tue , Oct 23, 2012 3:37:41 GMT
The thing im trying to do right now is pulling in multiple links from a textarea,
We can pretend that a user inputs c:\pics\img01.jpg and in the next row he'll have the next imglink.
I want to pull those links, I allready have the code for that:
var entered = $('#filedir').val();
var lines = entered.split(/\r\n/);
var opttext = "";
for(var i=0;i<lines.length;i++) {
opttext += '< img src="' + lines[i] + '">< /img>';
}
?
the problem is in the output which is:
< img src="file:///C:/pics/img01.jpgc:/pics/img02.jpg">< /img>
There should be two < img> elements..
Where am I going wrong?
I've been at it for a bit over 2 hours now..
Why would somebody use an expression like
var obj = {};
if(!!obj) alert('exists');
instead of just
if(obj) alert('exists');
?
Is there another usage for the "!!" thing ?
I seem to have another issue that I am not conquering. Real simple premise.
I have a mousedown event, and basically IF one particular element on the page is clicked, I want nothing to happen, else I want hide() some div.
$(function(){
$("document :not(#_ignorelement)").mousedown(function(event){
if($('#_hidethiselement').length){
$('#_hidethiselement').hide();
}
})
})
That is not working at all. I also tried the following:
$(document).not($("#_ignorelement")).mousedown(function(event){
$(document).not("_ignorelement").mousedown(function(event){
IF I can solve that, curious how I would actually have ":not" encompass the parent div, like so:
$().not("_ignoreelement").parent().closest('div').mousedown(function
Because the element "_ignorelement" is an anchor tag that is in a div. Wonder how I can use the parent div perhaps, instead of the anchor tag.
Anyways, any help would be appreciated.
Hi,
Is there a way to search the DOM for an element with a particular stylename class? Something like:
var node = document.findByClassName("foo");
if so, will this be extremely slow if my page has like 2000 elements in it or so?
Thanks
That's it basically. Storing the click coordinates is obviously the simple step, but once I have them if the user comes back and their window is smaller or larger the coordinates are wrong. Am I going about this in the wrong way, should I also store an element id/dom reference or something of that nature.
Also, this script will be run over many different websites with more than one layout. Is there a way to do this where the layout is independent of how the coordinates are stored?
Thanks.
Because windows xp renders certain fonts so poorly, i would like to detect whether the user is using that OS and add a class to the body accordingly.
I'm looking ideally for an html conditional statement or php $_SERVER var to do this
However failing that a piece of javscript along the lines of below would do
if(users_os === 'xp'){
$('body').addClass('xp');
}
What avenues should i be persuing?!!!
thanks!
My phonegap application works great but there is a glitch when it is sent to the background or "paused". When focused is returned to the app a high percentage of the time the interface is frozen and then the application crashes a few seconds later. When relaunched it is working fine again.
Could anyone provide some information as to what could be causing this and where I should start trying to debug it?
Thanks very much.
Hello,
I am using a menu that switches from standard state to select state for an item by reading the current url
var where = document.location.href;
My issue is that when using Firefox, if I switch to some items from the menu (for instance, I click home, donwload, contact) and press the back button the url is not read correctly so 2 items remain on the selected state. This only happens in Firefox (I've tested already in Explorer, Chrome and Opera)
So what I'm trying to ask: is there a way to handle the so called back button action in/for Firefox so I can fix my menu issue ?