Thirusha 20 Posting Whiz

As far as I know there is no such thing as getElementsbyId there is only getElementById .

The id's have to be unique, see also w3schools

Thirusha 20 Posting Whiz

I think it is better that you give all the fields unique id's.
If the fields are not going to change and not increase at any time, then you could just do a basic if else statement.
If the fields are going to increase then just loop through them, first you have to determine the length of the fields in the form.

var form1 = document.forms[formName]
//formName being the name of the form
for (i = 0; i < form1 .length; i++) {
inp= form1 .elements[i];
if (inp.value.length == 0){
alert("Please enter value in field" + inp.name);
}
}

this is by no means 100% correct code, it may need some tweaking, its just to give u a direction to go in.

Thirusha 20 Posting Whiz

Have you used firebug with Firefox, cause i get an error in FF
first error:
cannot access optimized closure
function v(){var a=document.getElementsB...t(a)}}w(window,navigator,document);})()\n

second error:
GET http://www.dealpigeon.com/dm/image/imagelist.php?id=12
404 Not Found

Thirusha 20 Posting Whiz

Why dont you just send the name of the element or id of the element in to the onchange function, send the element using "this", so the function call could be something like this :

... onchange="callMe('elementId')"

or

... onchange="callMe(this)"

Then inside the callMe function u will then have the element ID or the element object available to you.

Thirusha 20 Posting Whiz

My pleasure, please mark this thread solved if your question has been answered to your satisfaction.

Thirusha 20 Posting Whiz

You can have a look at freeaspupload or
webreference.com

Thirusha 20 Posting Whiz

Nope, Ajax is client side, so no need to do any server side configurations.

network18 commented: precise explaination :) +1
Thirusha 20 Posting Whiz

You weren't really calling the function, it starts running when the page loaded. I see that you are changing the href attribute to a hash inside the loop, so i modified your code to look like this:

<html>
<body>
<form>
<a  onclick="change(this)" id="static" href="#">link1</a></br>
<a  onclick="change(this)" id="static" href="#">link2</a></br>
<input type="text" id="spec" name="content"/>
</form>
<script>
	function change(object){
		var inputobj = document.getElementById("spec");
		inputobj.value = object.innerHTML;
	}
</script>
</body>
</html>

If u click on the links than that "innerhtml" is displayed in the textbox.

I had removed the loop since there was no need to have it, as all u want to achieve is click on the link and the value appear in the text box

Thirusha 20 Posting Whiz

when i first loaded this code into firefox it gave an error, then i changed this line:

#
function addit = function()

to this:

#
function addit ()

and it works in both FF 3.5 and IE 8

Thirusha 20 Posting Whiz

Are u then using a mysql database or an oracle database?

The commands to create tables and insert data are the same. what u can do is get sqldeveloper, then just create connections to the database, and then you can run the create and insert sql statements from there.

I would suggest netbeans as an IDE, its much easier than jdeveloper or eclipse with regards to ease of use.

Thirusha 20 Posting Whiz

I have never used the toplink program but to me it seems as though it just "creates" the sql statements for you.

Regarding mysql and oracle, they both require different drivers, other than that it should be ok to use the same code

Thirusha 20 Posting Whiz

what is the use....

sorry I don't understand your question.

Thirusha 20 Posting Whiz

i have used it, but it has been a while, Oracle 10G works just like any other database, it also has a console where you can do all the data admin stuff.

Thirusha 20 Posting Whiz

NoclassDefError, normally stems from not being able to find the class, in your case TagLibraryValidator

Ensure that this class is in the lib directory of your application

Thirusha 20 Posting Whiz

Google provides loads of links to examples online.
Try this one here

Thirusha 20 Posting Whiz

what you could do is preload the image and set its visibility to be hidden, then on the onclick event of the checkbox, you can just set the image to be visible.

OR

you can have a div next to the checkbox, then on the onclick even just change the innerhtml of that div to display an image.

Thirusha 20 Posting Whiz

u have to change the innerhtml of td tag.
so the onmousover event will look something like this:

onmouseover = "document.getElementById('tdId').innerhtml='<img src='imgname.jpg'>' "
Thirusha 20 Posting Whiz

If the information has been posted to the servlet, using request.getParameter will display the information passed.
You would use it something like this:

request.getParameter("firstname")
Thirusha 20 Posting Whiz

hello, i'm a student trying create a website using javascript. i am not familiar with javascript and i must use it to change only the content on my page. i have been stuck on this for days and i just cannot get it right.

a good place to learn javascript is w3schools

using the 960 grid on the website what is the code to remove the behavior of my sidebar links?

I have no idea what this means

also how do i add an onClick feature to my sidebar links?

you add an onclick event like this:

<a onlick="somejsfunction()">click here</a>

the last question i have is. what is the correct code to change only the content of the page while everything else remains the same??

for this you will use ajax, which you can also learn at w3schools here

Thirusha 20 Posting Whiz

I am not sure sure if this will help, but i had done something a similar, what i did is create a json string using javascript on my jsp page after button was clicked, then sent the json string using ajax to a servlet. In the servlet i used request.getParameter to get the json string, then looped over it using the libraries from the json.org site

Thirusha 20 Posting Whiz

You could do a check on the value something like

if (tBox.value != ""){//proceed to next question}else{alert("Please enter a value in the textbox")}
Thirusha 20 Posting Whiz

Without being able to see your code, all i can say is that u can do a comparison on the value returned by responseText, something like

if (responseText == "no"){
//do something}else{//do something else}
Thirusha 20 Posting Whiz

You are going to need a server side language to connect to the database, Peter_budo has written a nice tutorial here

Thirusha 20 Posting Whiz

Seems CSS3 has a marquee property, click here

I know that a marquee can be done using javascript, so check these out too

Thirusha 20 Posting Whiz

@Peter_budo, based on his question, i think that i am correct in saying that it cant be done, one can use ajax, but you will still need a server side language, one cannot connect directly to the database just using javascript.

Thirusha 20 Posting Whiz

Go here

Thirusha 20 Posting Whiz
<c:redirect url="http:www.someurl.com" />
Thirusha 20 Posting Whiz

Yes you can.

Thirusha 20 Posting Whiz

I haven't had the need to write one, but there are loads of examples online, using google i came across this one

Thirusha 20 Posting Whiz
use DATABASE_NAME

SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
Thirusha 20 Posting Whiz

I dont think you can do that, you are going to need a server side language, like ASP, Java, PHP etc that will be able to communicate with the database.

Thirusha 20 Posting Whiz

You can go here and learn about AJAX, that will help you with what you are intending to do.

Thirusha 20 Posting Whiz

can you please provide some code, it would make it easier to help you.

Thirusha 20 Posting Whiz

Ensure that your virtual directory that the anonymous access is Checked.

Also check this page

Thirusha 20 Posting Whiz

By numeric validation do u just want to validate that numeric characters were entered in the form?

Thirusha 20 Posting Whiz

To display a bigger image you can use teh width and height attributes of the img tag, just as you have done in the code presented.
to change the display to more than 12, in the code that gets the records from the database must be limiting it to 12.

The code that you have provided will only display one image, there should be more code than that. you will have to provide teh rest of the code for more help on increasing the number of pictures to display

Thirusha 20 Posting Whiz

do a google search for "javascript example autocomplete" loads of examples are then available

Thirusha 20 Posting Whiz

You run javascript in a browser, u can include it inside the html file or link it to the html file by calling the javascript file (yes the name should be filename.js) (filename being whatever name you want to call it.)

the best place to find the basics about javascript is at w3schools

Thirusha 20 Posting Whiz

They will show the same name because you can only hard code one element id, what u can do is this:

onmouseover=fu(this)

then in the javascript function change it to this:

function fu(el){
alert(el.name);
}

by sending in the this property u are sending the element object to teh function and thus will be able to retrieve any attribute of that element.

Thirusha 20 Posting Whiz

Pleasure

Thirusha 20 Posting Whiz

I think you should add the javascript provided to a function then call the function using the body onload event, it will then work.

Thirusha 20 Posting Whiz

The .html file did not recognize/read the .css file?

Thats very strange, could u place the code that u are using with the style inside the same file please, and i can take a look as to why it isnt reading it.

Thirusha 20 Posting Whiz

Yes, i dont know what your table structure is, but u can put it in a field.
You can create a url field in one of your tables and insert into that field.

Thirusha 20 Posting Whiz

I see that your original problem http://www.daniweb.com/forums/thread229724.html has been solved please mark that as solved so that people dont answer a thread that has already been solved.

Now onto your new problem, the code that is causing your page to open in a new window on page3.html is this:

<a href="page4.html">click</a>

What u need to do is call the same ajx function you use in the menus.

<a style="cursor:pointer" onclick="open_page('page4.html','content')">click</a>
Thirusha 20 Posting Whiz

I dont know much about php, but I do know that you can only insert data into a database using a server side language, so you are going to have to edit your php page.

Thirusha 20 Posting Whiz

Try increasing the size of the textbox by using the width attribute.

<input type="text" style="width:250px" name="tBox1" />
Thirusha 20 Posting Whiz

I checked online, and came across this on the microsoft technet site, which says u can secure a file as well.

Thirusha 20 Posting Whiz

You are using a stylesheet, which i presume should be the same for all teh pages. I dont see how it can be looking different. Would it be possible to paste the code for teh two pages that are looking different.

Thirusha 20 Posting Whiz

I dont know anything about tripod/lycos but from the code you have provided, in order to change where the page goes to after submission, you are going to have to edit the file referred to in teh action atttribute.

As to why the submit button is greyed out, unfortunately nothing in the code provided can explain that one.

Best thing will be to contact their support and not give up until they answer you.

Thirusha 20 Posting Whiz

You almost had it, just teh slashes have to be backward slashes so link should look something like this:
\\servername\fioldername\filename.blah