aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes passing variable from inner window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "passing variable from inner window" Watch "passing variable from inner window" New topic
Author

passing variable from inner window

Rajpreet Bajwa
Greenhorn

Joined: Feb 09, 2002
Posts: 14
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);
}
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rajpreet Bajwa
Greenhorn

Joined: Feb 09, 2002
Posts: 14
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

Joined: Feb 09, 2002
Posts: 14
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

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


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: passing variable from inner window