• 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

passing variable from inner window

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying out the inner windows [using DIV] with javascript for the first time.

On my main page, on click of a button I create a new inner window [ using a javascript function from http://scriptasylum.com]. Now while using this function, I supply html [6 argument to popUp] that should be displayed in the inner window. The html displays three text boxes and a save button. When the user presses the save button I want to invoke another javascript function with the values of the three text boxes. I am unable to see the values of the textboxes in my function.

Code for creating popUP
---------------------------
function1 createPopUp(){
new1 popUp(200, 100, 300, 175, ('popupID'+123), 'Name.<br><input name=\"name\" value=\"<c ut value="${report.Name}" />"\> Email.<br><input name=\"email\" value\"<c ut value="${report.Email}" />\"> UserId.<br> <input name=\"userId\" value="<c ut value="${report.User}" />" /> <button onklick=edit(name,email,userId);>Save</button>', "white", "gray", "8pt sans-serif", "Modify ", "lilac", "white", "#dddddd", "gray", "black", true, true, true, true, false);
}

Code which is invoked from the pop up
-------------------------------------
function1 edit(name, email, userId){
alert1("Hello"+$name+$email+$userId);
}
 
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
I strongly suggest you edit your post to:

1) clean up the code of smilies
2) use UBB code tags
3) show the results after JSP processing
 
Rajpreet Bajwa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rajpreet Bajwa:
I am trying out the inner windows [using DIV] with javascript for the first time.

On my main page, on click of a button I create a new inner window [ using a javascript function from .]http://scriptasylum.com]. Now while using this function, I supply html [6 argument to popUp] that should be displayed in the inner window. The html displays three text boxes and a save button. When the user presses the save button I want to invoke another javascript function with the values of the three text boxes. I am unable to see the values of the textboxes in my function.

Code for creating popUP
---------------------------

Code which is invoked from the pop up
-------------------------------------

 
Rajpreet Bajwa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apologies for posting without UBB tag, I couldn't find a way to alter my original post. However, I have added code tags in the reply.

Also, I think I found a way out for my problem. I am using form element in the inner html and using document.getElementsByName to get the values posted by the user. Somehow getElementById did not work.
 
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

Originally posted by Rajpreet Bajwa:
I couldn't find a way to alter my original post



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic