Connecting Tech Pros Worldwide Forums | Help | Site Map

div problem

Simon
Guest
 
Posts: n/a
#1: Nov 3 '05
Hi all,

Firstly I'm a newbie so apologies if there is a simple solution to
this.

Basically I'm trying to create a simple data retreival page.

I've got a form for users to fill in. The data from this form is passed
to a SQL Server backend and used to query a few tables.

A recordset is then returned to the same webpage and displayed.

I want to hide the table to display the data until the user clicks on
the submit button.

I can work out how to do all the hiding and showing with divs, but my
problem comes in that when the user clicks on the button the data
flashes up on the page and then disappears again.

I'm assuming this is because on the form submit button the data is
passed and retrieved, then the div is shown and then straight away the
page is reloaded and so the div disappears again.

How do i stop the div disappearing again!?

Any help is much appreciated.

Thank you.


marco_giuliani_it@hotmail.com
Guest
 
Posts: n/a
#2: Nov 3 '05

re: div problem


depending on your programming language you need to

get url parameter for div visibiliy e.g. divvisibility - if one doen't
exist then set to "hidden".
In your form have a hidden field called divvisibility and have the
value either set to visible or set it on submit.
when the page reloads the div visibility parameter is set so the div
will be visible;

code snippets for JSP
<%
String divvisibility=
((request.getParameter("divvisibility")!=null)?req uest.getParameter("divvisibility").toString():"hid den");
%>

<div id="resultDiv" name="resultDiv"
style="visibility:<%=pointvisibility%>; position:absolute; width:22px;
height:27px; z-index:151; left: <%=pointposx%>px; top:
<%=pointposy%>px;">
......
......
.....</div>

Marco

marco_giuliani_it@hotmail.com
Guest
 
Posts: n/a
#3: Nov 3 '05

re: div problem


depending on your programming language you need to

get url parameter for div visibiliy e.g. divvisibility - if one doen't
exist then set to "hidden".
In your form have a hidden field called divvisibility and have the
value either set to visible or set it on submit.
when the page reloads the div visibility parameter is set so the div
will be visible;

code snippets for JSP
<%
String divvisibility=
((request.getParameter("divvisibility")!=null)?req uest.getParameter("divvisibility").toString():"hid den");
%>

<div id="resultDiv" name="resultDiv"
style="visibility:<%=pointvisibility%>; position:absolute; width:22px;
height:27px; z-index:151; left: <%=pointposx%>px; top:
<%=pointposy%>px;">
......
......
.....</div>

Marco

Closed Thread


Similar JavaScript / Ajax / DHTML bytes