Not sure if i m understanding u correctly but u just need to have a space " " between the quotes
mr_scooby commented: awesome helper +2
Not sure if i m understanding u correctly but u just need to have a space " " between the quotes
then it should work, it worked for me.
is the div1 div loaded before u run the function. based on what u have provided, one can dynamically make an element visible, as my example showed, if yours is still not working, then it could be something else in your html or script files. can u provide the complete file?
You are calling the function incorrectly, you should call it like this:
<input type="text" id="test" style="visibility:hidden" />
<input type="text" id="test2" onclick="myFunction('test')" />
take note of the single quotes on the id sent into the myfunction function
can u provide an example of what you are doing to call this function, it could be something in your html that is causing the error, also please use code tags, makes it easier to read code.
I dont know much about php, but first change the submit button to a normal button
<input type="button" name="submit" VALUE="Submit" onclick="sendInfo()">
and use the onclick property to call your ajax function, there are many examples of a simple ajax function on the internet.
You can look in the code to see where he is writing stuff to, it should say somewhere in the code what tables he is sending information to and also what fields to populate.
I tried your code out and am able to return a string which has the name and the value of the textarea field, could you provide your html, maybe something is wrong in their.
but aren't u at the top of the page when u click tabs, how can it then jump, and it has to start at the top, cause people read from the top to the bottom.
I dont understand what is going wrong with the tabs, for me the exact code works fine, perhaps u should include the code you are using, maybe it is some style in your own code that is causing the page to jump
Really simple error. what was happening was that your variable was never set to 10 because the function was never called.
In your addfunction function change this:
myButton.onclick = addRadio;
to
myButton.onclick = addRadio();
window.open("www.google.com", "_parent")
will make the page open in the same window. so according to your code this should work :
winslide=window.open(slidelinks[whichlink], "_parent")
You have said u have tried, it, so from the code that u have provided i cant see what could be wrong, please provide the full html as well,
do u want to validate the input field, or the actual file?, that is, did the user upload a file or just type in some random crap into the field?
ensure that the element that u are referring to has loaded before the "focusFunction" function is called
Have u tried accessing the script directly in the browser, by calling the file in the browser? cause sometimes you are just not accessing the file, the location of the file could be incorrect. maybe it is another level up, also ensure that the file is saved the same way u are calling it.
I know the above sounds silly and one cannot possibly have gotten that wrong, but we are human and make mistakes, sometimes its just the simple things we get wrong
Do you want someone to code that for you? or are you stuck somewhere trying to put your plans into action?
Yes this is doable using javascript, add an id parameter to the drop downs then on the javascript function call the id's, there are loads of examples to disable and enable an element on the internet to help u along as well. you can also look into using jquery, makes it much easier, no need to actually code anything just call the function.
Yip that looks like jsp/java.
I dont understand why you have a method name as a value for a string, it would be much simpler for u to do:
String s="he is a good boy";
out.println("<input type=text value='"+ s + "' name=s>");
if you wanted the words good boy to appear in double quotes just escape the double quotes like this:
String s = "he is a \"good boy\" "
There is no such thing as
<input type="image" ...>
Change entire tag to and <img> tag something like this:
<img src="/button.gif" onclick="displaySomething('stuffToShow', 'aForm')">
Lady Antebellum, their first album, loving it.
so why isnt it marked as solved then?
how about putting that array in a form and submitting the form.
One cant use client side code to get the server side code, if u try printing out the userId it should be there. what u can do is assign the userId to a hidden field then alert the value of the hidden field.
Have u tried placing the site in the safe sites list, that message is standard from IE.
Listening to the new albums of eminem and christina aguilera, and loving it
I think that is the problem then. what jdk are u using? I think if u use the same version then is should work, but for example if you are using a higher jdk on weblogic 10 it is definitely not going to work in weblogic 7
Using jquery u can do it like this:
<p id="email" >some text</p>
<button id="but1" name="Collapse" value="Collapse">Collapse</button>
<script type="text/javascript">
$(document).ready(function() {
$("#but1").click(function(){
$("#email").slideToggle("slow", function(){
$("#but1").html($(this).is(":hidden") ? "Expand" : "Collapse");
});
});
});
</script>
check that your class is in the WEB-INF/classes folder.
unfortunately i have no experience in php drupal, hopefully someone else out here can help
Can you provide the code that you are using please.
i dont think it can be cancelled, just mark it as solved.
i don't think the onsubmit function is being performed as it is on the button, and if your button is of type submit it will submit the form immediately, have you tried placing the onsubmit function on the form?
another question, after the form submits, the page that it submits to, does it have the field you are sending the focus to?
since it is ajax, u should be able to just call the original page, the one that doesn't have any values.
where is your form submitting to, it could be that when the form submits, the element is no longer on the page or not in the same place as it is before it is submitted there it is being set to the top of the page.
could u include your entire code please
Just by reading the code I noticed that you are calling this function "GoNext()" but nowhere in the code is there such a function.
Another thing you don't need to use the "javascript:" anymore, the browser will know it is a javascript function that you are referring to.
Have u tried using the setTimeout() function?
your welcome ,did you find the rest of the drive .sorry about the missed letters in my last post ,didn't even notice ,my laptop keyboard must be acting up.
Sorry for the late reply, was so busy didnt have time to log on to daniweb. I did find the rest of the drive, dont worry about the missing letters, i understood what u were saying.
Thanx again.
Hi
I bought a new laptop which came with windows 7 pre-installed.
I am supposed to have a 500GB HDD space, but when i view "Computer" which also displays the available size, it says i have 11GB of 40 GB left! but i have a 500GB hard drive.
when i switched on the machine i had to press F2 so that windows as well as the hardware could be configured, the laptop has a hitachi drive, i remember i could either choose to partition the drives or not, i chose not to, could that be the problem, do i have to re-configure the machine to show me the correct hdd space?
Someone please help....
First you have to supply the problem then we will help with a solution. We will not however complete your homework for you
1 sets the variable obj to an array of the form that is supplied within the square brackets, if there is nothing in the brackets and it is written like document.forms[] you will then have access to all forms on the page. I think this gives a better explanation.
the name and ID of an element does not have to be the same, it must just be unique. naming(name and id) it the same thing is just easier for me. I found a nice link that explains all the form attributes.
it goes to login.php cause that what u specified in the form action attribute, i didnt change that.
I am not sure how php works, but once you submit the form, all fields should be available for you to access on the login.php page, it works that way for other server languages as well.
All that
document.forms[formObj].submit();
does is just submit the form, the same way have a submit button would submit the form.
I dont know PHP, but what u can do is alert the variables before u put them inside the url variable.
Also i think your ajax code is incorrect, this
request.onreadystatechange = parseResponse(request);
should be:
request.onreadystatechange = parseResponse;
You dont need to send the request variable to that function. also the function parseResponse would then not accept a variable.
they could just be redirecting you to another page without changing the url, or they could just be using ajax, but replacing the entire pages innerhtml.
the problem could be with the id that u are sending to the onclick function, but without seeing any code, its hard to say that is the problem.
if you have given your td tags unique id's u can use the innerHTML attribute to get the values.
Some code will be helpful so that we better understand what you are working with.
You will then need to employ the innerhtml attribute, this is what u need to do, first create empty p tags with an id, remember id must be unique.
then in the if statement you insert this:
document.getElementById("pTagId").innerHTML = '<a href="image1.gif"><img href="zoom.gif" /></a>'
where pTagId = the unique id of your p tag.
another thing your current javascript is not going to work properly since you havent closed the tags. Based on the last posts code:
<html>
<head>
<script type="text/javascript">
function test()
{
t = document.getElementById("p123");
w = t.width;
h = t.height;
// Dont know what shuld be come over here
and I am looking for the same
[B]}[/B]
</script>
</head>
<body onload="test();">
<p><img width="300" alt="Graphic" id="p123" src="image1.gif" /></p>
<!-- It will be displayed on browser only -- ><p><a href="image1.gif"><img href="zoom.gif" /></a></p>
<p>TEST</p>
</body>
</html>
please insert the closing bracket(in bold and in red) in your code.
You use an if statement:
<script type="text/javascript">
function test()
{
t = document.getElementById("p123");
w = t.width;
h = t.height;
if (w > 300){
// do something here
}
}
</script>
I am not sure what you mean by bottom line must show, if you are talking about the words "TEST" must show, then first give the tag and id attribute, then use the style="display:none" attribute on the p tag, then in the if statement(where i wrote do something), add this:
document.getElementById("idOfPTag").style.display = "block"
I don't think your code was going to work the way you want it to.
so i have tweaked your code to this:
<script>
function checkAll(formObj)
{
var obj = document.forms[formObj];
//obj[0] = document.getElementById("name");
//obj[1] = document.getElementById("psw");
//alert(obj.length);
for (i=0; i<obj.length; i++)
{
if (obj[i].value == "")
{
//alert("inside formObj here111");
alert("Input item on Row #"+(i+1)+" has been left empty. Please make sure you input something into this field.");
obj[i].focus();
return false;
}
}
document.forms[formObj].submit();
}
</script>
<form action="login.php" method="post" name="postingForm" id="postingForm" >
<label>Username<br /><input id="input1" type="text" name="username" /></label><br />
<label>Username<br /><input id="input1a" type="text" name="usernamea" /></label><br />
<label>Email<br /><input id="input2" type="text" name="email" /></label><br />
<label>Password<br /><input id="input3" type="password" name="pswd1" /></label><br />
<label>Password Again<br /><input id="input4" type="password" name="pswd2" /></label><br />
<input type="button" name="submitbtn" value="Submit" onclick="checkAll('postingForm')" />
<input type="reset" value="Reset" />
</form>
I have added an extra field just to see if it works if you add more fields.
I think it is safer to have a normal button instead of a submit button(type="submit"), and use an onclick event because a submit button will always submit the form, even if there are errors, and no one wants that, it is very dangerous.
try it out, and let me know what you dont understand, and i can explain why i did it that way.