Thirusha 20 Posting Whiz

Not sure if i m understanding u correctly but u just need to have a space " " between the quotes

Thirusha 20 Posting Whiz

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?

Thirusha 20 Posting Whiz

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

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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

Thirusha 20 Posting Whiz

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();
Thirusha 20 Posting Whiz
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,

Thirusha 20 Posting Whiz

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?

Thirusha 20 Posting Whiz

ensure that the element that u are referring to has loaded before the "focusFunction" function is called

Thirusha 20 Posting Whiz

my pleasure :)

Thirusha 20 Posting Whiz

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

Thirusha 20 Posting Whiz

Do you want someone to code that for you? or are you stuck somewhere trying to put your plans into action?

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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\" "
Thirusha 20 Posting Whiz

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')">
Thirusha 20 Posting Whiz

Lady Antebellum, their first album, loving it.

Thirusha 20 Posting Whiz

so why isnt it marked as solved then?

Thirusha 20 Posting Whiz

how about putting that array in a form and submitting the form.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

Have u tried placing the site in the safe sites list, that message is standard from IE.

Thirusha 20 Posting Whiz

Listening to the new albums of eminem and christina aguilera, and loving it

Thirusha 20 Posting Whiz

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

Thirusha 20 Posting Whiz

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>
Thirusha 20 Posting Whiz

check that your class is in the WEB-INF/classes folder.

Thirusha 20 Posting Whiz

unfortunately i have no experience in php drupal, hopefully someone else out here can help

Thirusha 20 Posting Whiz

Can you provide the code that you are using please.

Thirusha 20 Posting Whiz

i dont think it can be cancelled, just mark it as solved.

Thirusha 20 Posting Whiz

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?

Thirusha 20 Posting Whiz

since it is ajax, u should be able to just call the original page, the one that doesn't have any values.

Thirusha 20 Posting Whiz

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

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

There are loads of examples on the net, google will show you the way. here is a link i found

Thirusha 20 Posting Whiz

Have u tried using the setTimeout() function?

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

thank you soo much

Thirusha 20 Posting Whiz

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....

Thirusha 20 Posting Whiz

First you have to supply the problem then we will help with a solution. We will not however complete your homework for you

Thirusha 20 Posting Whiz

this question has been asked here many times. if you do a search on this site you will definitely come across more references, here is one though, w3schools

Thirusha 20 Posting Whiz

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.

mr_scooby commented: awesome helper +2
Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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.

Thirusha 20 Posting Whiz

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"
Thirusha 20 Posting Whiz

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.