Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Modal dialog


Message #1 by gbrown@c... on Thu, 21 Sep 2000 10:24:37 +0100
Here's some sample code that processes a checkbox collection.

In your form all related checkboxes must have the same name.

"""""" Sample Form""""""""""
<HTML>
<BODY>
<FORM action="CheckboxProc.asp" method=POST id=form1 name=form1>
<INPUT type="checkbox" id=checkbox1 name=checkbox1 value="Skill 1"> Skill
1<BR>
<INPUT type="checkbox" id=checkbox1 name=checkbox1 value="Skill 2"> Skill
2<BR>
<INPUT type="checkbox" id=checkbox1 name=checkbox1 value="Skill 3"> Skill
3<BR>
<INPUT type="checkbox" id=checkbox1 name=checkbox1 value="Skill 4"> Skill
4<BR>
<INPUT type="checkbox" id=checkbox1 name=checkbox1 value="Skill 5"> Skill
5<BR>
<INPUT type="checkbox" id=checkbox1 name=checkbox1 value="Skill 6"> Skill
6<BR>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</FORM>
</BODY>
</HTML>

"""""" ASP processing of  Form""""""""""
<%@ Language=VBScript %>
<HTML>
<BODY>
<%
 For x = 1 to Request.Form("checkbox1").Count
  'Your db processing goes here.
  Response.Write(Request.Form("checkbox1")(x) & "<BR>")
 Next
%>
</BODY>
</HTML>

********* End of code

Hope this helps.


Jacques
----- Original Message -----
From: "Bruce Allen" <BAllen@e...>
To: "javascript" <javascript@p...>
Sent: September 21, 2000 6:27 PM
Subject: [javascript] RE: Modal dialog


> instead of window.open()
>
> try: window.showModalDialog()
>
> It works, but I've been passing an argument to specify the height of the
> pop-up
> because the default behavior is often not so pretty.  The default width
> seems to
> work pretty well depending on what (html) is being displayed.
>
> Here's some code that works pretty well:
>
> <script language="javascript">
> function showHelpWindow(url,height)
> {
> if (browser() == 2)
> {
>        var tmp="";
> var options;
> if (!height)
> height = 500;
> options = "dialogHeight:" + height +
> "px;status=0;scroll=no;titlebar=false;center:yes;help:no;unadorned=no";
> showModalDialog(url,tmp,options);
> }
> else
> {
>
>
mywin=window.open(url,"win",'toolbar=0,location=0,status=0,menubar=0,scrollb
> ars=0,titlebar=no,resizable=1,width=446,height=340');
> mywin.focus();
> }
> }
>
>
> function browser()
> {
> if (document.all)
> return 2;   // MSIE4+
>
> if (document.layers)
> return 1; // NN4+
> return 0;
> }
> </script>
>
> Anyone care to expand on this?
>
> -----Original Message-----
> From: gbrown@c... [mailto:gbrown@c...]
> Sent: Thursday, September 21, 2000 2:25 AM
> To: javascript
> Subject: [javascript] Modal dialog
>
>
> Hi
>
> Has anyone come across a method to create a modal popup. What I'm trying
> to mimic is a dialog window which has to be filled in before allowing the
> calling page to continue. I've tried setting the popups onblur to set the
> focus back to itself but this doesn't work.
>
> Regards
> Graham
>
>


  Return to Index