• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pop up window+javascript

 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a 'pop' button...

CASE1: onClick of it I should pop up a window(ofcourse in Javascipt) like this...

enter Name: textbox
enter Age:textBox
Ok Cancel (buttons)

CASE2: When user clicks ok,the values should be added to an xml file as an element ,to a serializable object,to a db as a row!!!

Can anyone provide some inputs,samples for this CASE1 and CASE2 (how to,if possible ) ??


 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) window.open()

2) submit the form to the server
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1) window.open()



But how will i align my UI elements in Javascript? any sample code for this?


I mean ,I dont want it to be generated by main window.

I want a user defined one,like how we use a panel and align elements .
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure what you are asking. With window.open() you specify the URL of an HTML page to display within it (or JSP, or PHP or whatever).
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I gave like this...



I want it in the form of how an "alert" box appears... Like an plain window with a background(no address bar etc) and with the required elements.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are better off popping a div on top of the page and having a form in that. You are not going to make a new pop up window look like an alert.

Eric
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
something like this would work??



taking care of style in 'div' tag would do?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why the insistence on document.write()? That only works during initial page load, and is clunky even then.
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What else could it be Bear? Need some direction... Total tyro here !!!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
document.write() is really not all that useful, and rather old-fashioned. You're better off using DOM manipulation even at page load.

But my original point is, why are you trying to even create all this on-the-fly in the first place? Why not simply include an existing JSP or HTML file?
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would avoid that but don't know the other route!

why are you trying to even create all this on-the-fly in the first place? Why not simply include an existing JSP or HTML file?



you meant direct to a seperate page and then come back?

I thought it would be nice if we pop it within the page ,so that once it is added,the window dissapears and the new addition are immediately populated....

This is what I am told to do so!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, you'll need to explain that better, but it's clear that using document.write() will not achieve your aims.
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the main screen onclick of that button, I want to pop up a small window/panel(sub screen) with 2 textfields and 2 buttons with the main screen being disabled and onclick of 'ok' the pop up window(sub-screen) is hidden and the main screen is again enabled!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
document.write() is definitely not what you need.

The basic idea is to create an absolutely positioned translucent <div> element that covers the screen with a higher z-index than the rest of the elements. On top of this create another <div> that houses the "dialog" content and its chrome. When it's time to dismiss, just destroy the elements.

Or just check out the dialog widget of jQuery UI.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic