Connecting Tech Pros Worldwide Help | Site Map

div problem

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 3rd, 2005, 02:45 PM
Simon
Guest
 
Posts: n/a
Default div problem

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.


  #2  
Old November 3rd, 2005, 03:15 PM
marco_giuliani_it@hotmail.com
Guest
 
Posts: n/a
Default 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

  #3  
Old November 3rd, 2005, 03:15 PM
marco_giuliani_it@hotmail.com
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.