Thirusha 20 Posting Whiz

nope, but will keep working on it.

why dont u rather implement a function on the onlick event.
I personally dont like using the onblur event.

Thirusha 20 Posting Whiz

Your session attribute for value will be 4 since only one value is stored in an attribute, in the loop you are overwriting teh value, by the next number in the loop.

To get teh value of the link clicked, u can pass the value in the url so the url could look somehting like this:

<a href="ProductController?selectedValue=link&selLink="<%=obj%>>

then use request.getParameter to get the value of selLink

Thirusha 20 Posting Whiz

I dont know php, but have u have u tried writing out the sql statement. To me it seems as though the statement is looking for "$suburb", i think u have forgotten to put the curly brackets around $suburb, i say this cause i see to get teh value of the table u used the curly brackets, shouldnt the same be done to get the value for the variable $suburb?

Thirusha 20 Posting Whiz

There is a class called BufferedReader which you can use. You can try this code, i had it lying around, so i hope it still works, havent had to do such things in a long time:

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String input = br.readLine();
    System.out.println(input);
    br.close();
JameB commented: thanks! +1
Thirusha 20 Posting Whiz

One way to do that is set a session attribute

Thirusha 20 Posting Whiz

Your function Res() is incorrect, firstly there is no element named "opinion", so the function is failing on the first line:

opinion.value="";

Your code to "reset" the radio buttons is correct but you need to reset all of them, currently you are only resetting one

document.getElementById("op1").checked=false;

, for three radio buttons it is fine to do them individually, but if u have more it would be better to loop through the buttons and reset them.

Try this:

document.getElementById("op1").checked=false;
	  document.getElementById("op2").checked=false;
	  document.getElementById("op3").checked=false;
Thirusha 20 Posting Whiz

If the redirect is to look like this

response.sendRedirect("welcome.jsp?name="+userName);

then to get the username from the query string you would use it just as u did earlier (from your original post "String userName = ......") , like this:

<%=request.getParameter("name")%>
Thirusha 20 Posting Whiz

I am new to jsp but I would do either one of the following:

1. Set the username as a session variable and then in welcome.jsp u can use

<%=session.getAttribute("userName")%>

2. Send the username in the querystring when redirecting to the welcome page then just use

request.getParameter("userName")

to display it.

Thirusha 20 Posting Whiz

My pleasure.

Please mark as solved if the answer solved your problem.

Thirusha 20 Posting Whiz

You would write it teh smae way you would in html. just remember to escape the double quotes in the servlet.

It should look something like this:

out.println("<a href=\"http://www.google.co.za\">google</a>);
Thirusha 20 Posting Whiz

So what is it that you dont know how to do?

Thirusha 20 Posting Whiz

what about putting your page behind a log on screen?

Thirusha 20 Posting Whiz

So what u want to do is not let the header cells to stretch if u stretch the web page? or do u want the header cells to remain a constant size with the data cells stretching depending on the amount of data within those cells?

Thirusha 20 Posting Whiz

try googling "load an external js file". there are loads of examples on the internet.

Thirusha 20 Posting Whiz

I think it would be something like this:

weekdayname(weekday(ADt))
Thirusha 20 Posting Whiz

Glad to help :)

Thirusha 20 Posting Whiz

I think i got it to work, i changed a function in the dynlayer.js file

function DynLayer(id,nestref,frame) {

	if (!is.ns5 && !DynLayer.set && !frame) DynLayerInit()
	this.frame = frame || self
	if (is.ns) {
		if (is.ns4) {
			if (!frame) {
				if (!nestref) var nestref = DynLayer.nestRefArray[id]
				if (!DynLayerTest(id,nestref)) return
				this.css = (nestref)? eval("document."+nestref+".document."+id) : document.layers[id]
			}
			else this.css = (nestref)? eval("frame.document."+nestref+".document."+id) : frame.document.layers[id]
			this.elm = this.event = this.css
			this.doc = this.css.document
		}
		else if (is.ns5) {
			this.elm = document.getElementById(id)
			this.css = this.elm.style
			this.doc = document
		}
		
		
                //this.x = this.css.left
		//this.y = this.css.top
                this.x = this.elm.offsetLeft
		this.y = this.elm.offsetTop
		this.w = this.css.clip.width
		this.h = this.css.clip.height
		
	}
	else if (is.ie) {
		this.elm = this.event = this.frame.document.all[id]
		this.css = this.frame.document.all[id].style
		this.doc = document
		this.x = this.elm.offsetLeft
		this.y = this.elm.offsetTop
		this.w = (is.ie4)? this.css.pixelWidth : this.elm.offsetWidth
		this.h = (is.ie4)? this.css.pixelHeight : this.elm.offsetHeight
		
	}
	this.id = id
	this.nestref = nestref
	this.obj = id + "DynLayer"
	eval(this.obj + "=this")
}

the change is highighted in red

Thirusha 20 Posting Whiz

u have an onMouseDown and other onmouse methods on the buttons so the href doesnt matter, it was also opening new windows for me, in both IE and FF.

Thirusha 20 Posting Whiz

My apologies for breaking your code in IE :) Hope i dont break it further

Good news, i got the code to work in IE (i m using ie6 though) again, bad news it will not work in FF, i think it has a problem getting the height of the div using this.window.h from miniscroll.js
this.window.h returns an integer in IE and returns an undefined in FF.

I took the source from your site and made some changes in the html file and one in the miniscroll.js, changes are highlighted in red:

<HTML>
<HEAD>
<TITLE></TITLE>
<style>
     A:link {text-decoration: none; cursor: hand;}
     A:visited {text-decoration: none; cursor: hand;}
     A:text{text-decoration: none; text-align: justify; cursor: hand;}
     </style>
<base target="home">
<LINK REL="Stylesheet" TITLE="Main Stylesheet" MEDIA="Screen" HREF="innerspace.css">

<script language="JavaScript" SRC="dynlayer.js">

</SCRIPT>
<script language="JavaScript" SRC="miniscroll.js">

</SCRIPT>

<script language="JavaScript">

<!--
function init() {
        DynLayerInit()
	myscroll = new MiniScroll(scrollWindow,scrollContent)
}
//-->


</SCRIPT>
<STYLE TYPE="text/css">
<!--
#scrollWindowDiv {position:absolute; left:0; top:5; width:400; height:250; clip:rect(0,400,250,0);}
#scrollContentDiv {position:absolute; left:0; top:5; width:400;}
#scrollbtnDiv {position:absolute; left:400; top:5; width:30;}-->
</STYLE>

<script language="JavaScript">

<!--
preloadwh1 = new Image();
preloadwh1.src = "up.gif";
preloadwh2 = new Image();
preloadwh2.src = "down.gif";
preloadlogo = new Image();
preloadlogo.src = "logo.jpg";// -->
</script>
</HEAD>
<body onLoad="init()" text="#000000" vlink="#6699FF" link="#6699FF" alink="#000000" bgcolor="#FFFFFF" topmargin="10" leftmargin="0" marginwidth="0" marginheight="0">
<DIV ID="scrollWindowDiv">
<DIV ID="scrollContentDiv">
<table border="0" cellspacing="0" cellpadding="5" width="400">
<tr>
<td background="title.jpg" class="title"><b><font size=3 color=000000>Message</font></b></td>
</tr>
<tr>
<td class="normal">
<img align="right" src="logo.jpg" alt="" width="100" height="83">
A soft mechanical voice calls out to you. <br>
<br>"Greetings mortals and welcome... to Innerspace..."<br> …
Thirusha 20 Posting Whiz
Thirusha 20 Posting Whiz

I could be wrong but i think u have to put the quotation marks in

<input type="text" readonly name=MemberNommer id=MemberNommer value="<?php echo $MemberNommer ?>" />

I dont know php, so i m not sure if the double quotes will break the php code.

Thirusha 20 Posting Whiz

i understand what u need to do, but what have u done, can we look at some code that u have done.

Thirusha 20 Posting Whiz

In the miniscroll.js replace the following lines

this.contentHeight = (is.ns)? this.content.doc.height : this.content.elm.scrollHeight
this.contentWidth = (is.ns)? this.content.doc.width : this.content.elm.scrollWidth

with this

this.contentHeight = (is.ns)? this.content.scrollHeight : this.content.scrollHeight
this.contentWidth = (is.ns)? this.content.scrollWidth : this.content.scrollWidth

I tried to test it on my side with some of your code from the site, and no error is shown.

Thirusha 20 Posting Whiz

well u can submit a form from the onclick event on a button element.
with the form action being the file name or serlvet, or u could have a struts action, i would go with the struts action.

Thirusha 20 Posting Whiz

The problem is that in firefox it is not finding the div tags in the body of your file.
The function that has the problem is located in the dynlayer.js file

function DynLayerInit(nestref) {
	if (!DynLayer.set) DynLayer.set = true
	if (is.ns) {
		if (nestref) ref = eval('document.'+nestref+'.document')
		else {nestref = ''; ref = document;}
		
		for (var i=0; i<document.getElementsByTagName("div").length; i++) {
			var divname = document.getElementsByTagName("div")[i].id
			var index = divname.indexOf("Div")
			if (index > 0) {
				eval(divname.substr(0,index)+' = new DynLayer("'+divname+'")')
			}
			
		}
		if (DynLayer.refArray.i < DynLayer.refArray.length) {
			DynLayerInit(DynLayer.refArray[DynLayer.refArray.i++])
		}
	}
	else if (is.ie) {
		for (var i=0; i<document.all.tags("DIV").length; i++) {
			var divname = document.all.tags("DIV")[i].id
			var index = divname.indexOf("Div")
			if (index > 0) {
				eval(divname.substr(0,index)+' = new DynLayer("'+divname+'")')
			}
		}
	}
	return true
}

U can replace that function with this one, i hope it will work for u.

Thirusha 20 Posting Whiz

Have u tried using firefox's firebug?

I copied the code u provided and it doesnt work because DynLayerInit is undefined, i suspect it is in the dynlayer.js file. which u havent provided.

Please provide the other js files as well, it would help alot.

Thirusha 20 Posting Whiz
Thirusha 20 Posting Whiz

your id/name is just for use in your form dosent suit any purpose for the validation I gather?

I tend to always put the id and name attributes in, whether i use them or not, but for the example it was used in the submission of the form.

I hope it works for u :)

OmniX commented: saved me when no one else could! Thankyou so much! +1
Thirusha 20 Posting Whiz

It is available higher up on this thread but here it is again:

<table>
<tr>
        <td>Display Limit:</td>
        <td><input type="text" maxlength="5" style="width:95px;" name="displayLimit" onkeyup="checkNumeric(this)" id="displayLimit" value="100" /></td>
    </tr>
</table>
Thirusha 20 Posting Whiz

Try google, there are loads of examples and articles there, u can read this too www.elated.com/articles/javascript-and-cookies/

Thirusha 20 Posting Whiz

I am not yet an expert in jsp, but i think u have to submit the page before any of your parameters are set.

Thirusha 20 Posting Whiz

Hi

can u please paste some code, or elaborate on your problem.

Thirusha 20 Posting Whiz

If u tried my code, it will prevent u to enter any non-numeric characters, i am using both FF and IE6 to test it, and it works, yes u are right it does print out a message telling u that u have to use numeric characters only, but u can take that step out and the function will look like this:

function checkNumeric(entry)
    {
        var numeric = /^[0-9]*$/; 
        entry.value = entry.value.replace(/[^0-9]/g,"");
    }

when u type in there it will remove the characters as u type it in.

Thirusha 20 Posting Whiz

sure here it is:

<table>
<tr>
        <td>Display Limit:</td>
        <td><input type="text" maxlength="5" style="width:95px;" name="displayLimit" onkeyup="checkNumeric(this)" id="displayLimit" value="100" /><span id="errorText" style="padding-left:5px; display:none;" class='errorTextClass'>Only numeric characters</span></td>
    </tr>
</table>
Thirusha 20 Posting Whiz

I can help u out with the numeric one, if u search for regular expressions to restrict alpha and special characters, u should find something that works in both.

function checkNumeric(entry)
    {
        var numeric = /^[0-9]*$/; 
        if (!numeric.test(entry.value)) 
            {
               document.getElementById('errorText').style.display = '';
            }else{
                    document.getElementById('errorText').style.display = 'none';
            }
        entry.value = entry.value.replace(/[^0-9]/g,"");
    }
Thirusha 20 Posting Whiz

aah i understand now, (stupid me:$ )

try something like this:

<body onload="window.location.hash='bot'">
<div id="content" style="width:200px;height:125px;overflow:auto;color:#000000">
whatever u want to say in it
<a name="bot"></a>
</div>
</body>
Thirusha 20 Posting Whiz

dont go crazy, these things happen, and sometimes it will be a stupid thing that causes everything to break. But thats the fun of programming. :)

i think it must be the data, try changing the data that is used in the french recordset to the english or arabic one, without changin the code. if that works then it is definitely something in the data.


could also be double quotes somewhere in the string.

Just picked up something else:
shouldnt your hilighted portion look something like:

if session("CurrentLanguage")=cl then 
	sSub = Rs1(GetFieldName("Caption_A")) & ""
end if

if session("CurrentLanguage")=clF  then 
	sSub = Rs1(GetFieldName("Caption_F")) & ""
end if
Thirusha 20 Posting Whiz

I think it might have something to do with what it is pulling from the database, write out the sql, maybe there is some double quotes or reserved words in the sql.

Thirusha 20 Posting Whiz

I m not too sure if i am understanding your question correctly, but if u dont want to see the scrollbars then take out the overflow attribute from the div tag.

When u dynamically get teh data, why dont u get it so the latest will always be the first line in the element.

Thirusha 20 Posting Whiz

Thanx for the help, i have solved my problem, it was the form tags inside the table tag, so i moved my form tag above the table tag, and now it displays perfectly. :)

Thirusha 20 Posting Whiz

I have tomcat, but am using bea weblogic server., and tomcat is not running.

no errors displaying in firefox, is there another tool besides firebug?

I am getting no errors, part of the jsp is not displaying, if i view the page in a separate window it is there, but not when it is view as an inlude in my index page.

My page works like this,
I have an index page, which includes (lets call in pageA.jsp) i click on a button to go to pageB.jsp, then when i click back and call the struts action for pageA.jsp the heading on that page displays, and the table but none of the fields. I am using ajax to change from pageA to pageB and back again.

At first i thought it could be html tags not closing, but that isnt the case.

Thirusha 20 Posting Whiz

I too have a similar problem, i can see the code in the source it is just not visible, and i have no clue why :'( , i hope someone will be able to help

Thirusha 20 Posting Whiz

I too am new to jsps, but i do know that u will have to submit the form. use a submit button.

your code should look something like this

<form name="testform" id="testform" method="post" action="/yourjsppage.jsp">
<input type ="text" name="username" id="username" />
</form>
<input type="submit" name="submitme" value="submit" />

the text that u entered in username will then get posted to the next jsp page and the url will then look something like 'yourjsppage.jsp?username=blahblah'

On the next page u will be able to use request.getParameter() to get the value of the text field.

Hope this helps