Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show/hide div / popups

Status
Not open for further replies.

davejam

Technical User
Jan 6, 2004
313
GB
hi all,

i have come to a point where i need to enter/edit single bits of data within a form on request, i don't want to change the page i'm on and the popup boxes don't cater for what i need.

I have seen (and possibly used) in the past some javascript function within an asp page that pulls up and repositions a hidden div... i think, with a z index of 1 (although i'm guessing from memory here)

What i need...
I have a form where i have the fields locked as its standard data against a user, although i would like to have a couple of the fields able to change, but not within this form, i want it to popup asking for the new data, a confirm and then a submit of the info to the db.

I think i need to use a hide/show div but not entirely sure

Anyone got any ideas.... if i haven't confused to much

cheers

daveJam

*two wrongs don't make a right..... but three lefts do!!!!*
 
DaveJam, I think what your asking can be achieved using javascript. Although I'm still not entirely sure what your asking!

If it's just to have a popup when certain data is entered in a field on the main form then you could have something like this:

Head
Code:
function DoPop(){
day = new Date();
id = day.getTime(); /*Cache buster*/
eval("page" + id + " = window.open("myPage.asp?ID=" + id + ", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=200,height=200,left = 412,top = 284');");
}

function CheckData(CheckWhat){
if(document.getElementById(CheckWhat)=='ValueToCheck'){
DoPop();
}
}

body
Code:
<input type="text" id="text1" onchange="CheckData(this.id);">

Sorry if I'm way off with your requirements! (You could do this with Div's but I've opted for a popup to a new page instead!)

Nick
 
yes and no,

i want the data to be displayed on the screen, then when an edit button is pressed for an individual value, i need the screen to lock and pull up a centralised div (i think).

In this div i will accept a value dependant on the field edited (ie. dropdown, text, calendar).

When accepted submit to the database, but also have a cancel which will hide the div and unlock the page.

As i said, i've used this before, and i think it was by having a div specified but hiding it, then onclick show the div.

daveJam

*two wrongs don't make a right..... but three lefts do!!!!*
 
DaveJam, it's easy enough to have a div appear and disappear using:

Code:
 document.getElementById('mydiv').style.visibility='visible' /* or 'hidden'

however I'm not entirely sure how you would lock the background. I have saw this before and I think it was done by covering it with png and then displaying the div above this.

Like I said I've never done this but I'm sure if you post this in the javascript forum someone will be able to guide you through it. I would be quite interested to see how this is done also!

Sorry I couldn't be of any more help.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top