Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Passing parameter only in client side


Message #1 by "Joao Jaime" <gambitjj@h...> on Mon, 12 Nov 2001 16:40:40
--0-586291105-1005832532=:37775
Content-Type: text/plain; charset=us-ascii


 The submit button is used to pass parameters from client to server and, if the server receive the request, to send values to the
client. You can use submit buttons in the client-side too. But, not within a form, because the form request an action that, in
client-side, does anything. If you want to open a new window clicking a button passing parameters is simple. There are two ways to
do this:
- using showModalDialog() or showModelessDialog() methods:
     showModelessDialog("new.htm",whatYouNeed,sFeatures); whatYouNeed is what do you want: a number, a string, an object, a element
in the page, everything; sFeatures is a string consisting in options to display the window: status, help, resizable etc.
- using the window.open() method:
    In this situation you have to select the element taht you want to be the parameter. The parameter will not "pass" in the child
window, but you can access it for reading and writing. Passing parameters like values of textboxes or lists or other HTML elements
is simple. You will access a text box value in this way: In the window that has the submit button is a text box named "TextBox1". In
the window opened with open() method you will access it using the opener property of the last window.
window.open("new.htm") (on the submit button)
alert(window.opener.document.all('TextBox1').value); I recommend you to use the id property of the box too (<input type="text"
value="Text1" id="TextBox1" name="TextBox1"/>)
Good luck!
  Joao Jaime <gambitjj@h...> wrote: My problem is that i need to passe a parameter that i have in a form, to 

the next window, when i make a submit.

but i'm only working in a client mode, i can't use the request from asp.

any one can help??

best regards 
Joćo



---------------------------------
Do You Yahoo!?
Find the one for you at Yahoo! Personals.

  Return to Index