I wanted to display a hidden div in function after it will do some things but it doesn't work. Could you please help me with it? Here is what i tried to do:
#Edit
Ok, it's the code in short. After i click link calc there is a form, and after i click on input submit, there is and alert, and then it should display a div, but that's not working.
http://pastebin.com/XU58GhFv
Try to put the id directly in JQuery.
`$("#evolves-calculator").css('display', 'block');`
Related
I have a form which contains two file input and two check box and one submit button. With my current code when the user click submit button the jquery validation will work perfectly but the problem was the custom error class was not applying and not removing correctly for example if the user click the check box that particular errorClassshould be removed this was not happening. When i search through SO I got one use full information it was mentioned instead of using border red for the check box or if the upload any file that particular field errRed class should remove and I try using outline-color but this was also not working. It might be simple somewhere I am missing some bit of code
I tried giving $('.chk_requ').removeClass('errRed_chkb'); still no use
Here is the fiddle link
kindly please help me.
Thanks in Advnace
Instead of remove class you can add empty div with id="diverr" there and give it desplay:none;
$("#diverr").text("Please select Gender");
$("#diverr").css("display","list-item");
if condition is false then
$("#diverr").css("display","none");
I have a textfield and a button on the page:
<textarea class="txCS" id="text-area"></textarea>
<span id="search-button">Search</span>
What I try is simple, write some text in the textfield and click "Search".
browser.TextField("text-area").TypeText("Some Text");
browser.Span("search-button").Click();
TypeText() works, I see my text gets written on the textfield, Click() also works because I see WatiN highlights it when it clicks the button, but nothing happens when it clicks the button.
When I click the button myself still nothing happens, but when I type something in the textfield manually and click Search then everything works, as if the page knows if a human is interacting with the page and allows searching...
I montiored the events fired when I type someting in the textfield and then tried to fire them using WatiN:
searchBox.FireEvent("onmouseover");
searchBox.FireEvent("onmousemove");
searchBox.FireEvent("onmousedown");
searchBox.FireEvent("onfocus");
searchBox.FireEvent("onmouseup");
searchBox.FireEvent("onclick");
searchBox.FireEvent("onkeydown");
searchBox.FireEvent("onkeypress");
searchBox.FireEvent("onkeyup");
searchBox.FireEvent("onchange");
searchBox.FireEvent("onblur");
That didn't work either. Am I doing something wrong here?
Just as a reference for others the problem with your code is that you are trying to click a span instead of a button. Unless you 100% sure that the clickable element is a span you should use the following code with Watin:
browser.Button("search-button").Click();
And that should do the trick
I want to show the text that is in a ul tag one by one on mouseover of some text. It is showing some error. How can I fix it?
You can check the code mouseover on "hover here hover again" link in a link. Is there another way to do it?
You are gettign errors because you are calling a function which is not defined:
hideCaption
I have a webpage. I want to write a javasript function that will make the html page as a huge excel sheet and put a place holder on a particular row and column. Thus on loading the webpage the place holder will be called by the function and a auto click will be made on that particular row and column.
Does anyone know how to code this function?
I can provide the raw script of the webpage if asked.
Thanks.
if foo has a click event then
$('#foo').trigger('click');
will call the event.
If you are just trying to focus on particular control you can just use :
$('#foo').focus();
Use jQuery:
$(document).ready(function(){
$("#ThisMustBeClickedId").trigger('click');
});
Provided you may add jQuery, that you can foresee the id, or otherwise select the cell or what it is..
If you're using jQuery:
$(document).ready(function(){
$('#your-cell-selector').click();
})
I want to disable/enable a button with JavaScript. Because the JavaScript is called, after a Flash animation is rendered, the button exists at the time of the execution.
The button is in a hierarchy:
<html><body><form#form1><div#control><asp:Button#Export1>
I tried for hours to get a reference to that button, but nothing seems to work:
document.getElementById("Export1")
// and
document.getElementbyId("form1").getElementById("control").getElementById("Export1")
// and many more
How to get a reference to that button (in order to change btnref.disabled = true)?
Thanks a lot for your help!
Have you tried right-clicking in the document and selecting "view source" to see how that code actually renders? An asp:Button is a server control, that gets translated to an input field during render. During this, the ID of the field will not be exactly what you set it to in your aspx.
You can use Export1.ClientID at serverside to get the ID of the control.
If it's the only button in your div, this should work:
var btnref = document.getElementById("controls").getElementsByTagName("button")[0];
Usually the id of the button won't stay the same in the page source. Click on view source in the HTML and look for that tag to find the new id. You can then use that id in something like:
document.getElementbyId("Export1_some_unique_id")...