Simple Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Senraba

    Simple Question

    I would like to have a 600 X 400 window open with search results from
    CPanel's Entropy Search form.

    I have the following in the <HEAD> tag:

    <script language="javas cript" type="text/javascript">
    <!--
    var win=null;
    function NewWindow(mypag e,myname,w,h,sc roll,pos){
    if(pos=="random "){LeftPosition =(screen.width) ?Math.floor(Mat h.random()*(scr een.width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen.heigh t-h)-75)):100;}
    if(pos=="center "){LeftPosition =(screen.width) ?(screen.width-w)/2:100;TopPositi on=(screen.heig ht)?(screen.hei ght-h)/2:100;}
    else if((pos!="cente r" && pos!="random") ||
    pos==null){Left Position=0;TopP osition=20}
    settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ ',scrollbars='+ scroll+',locati on=no,directori es=no,status=no ,menubar=no,too lbar=no,resizab le=no';
    win=window.open (mypage,myname, settings);}
    // -->
    </script>

    I have the following <FORM>:

    <form action="/cgi-sys/entropysearch.c gi"
    onSubmit="NewWi ndow(this,'join ','600','400',' no','center');r eturn
    false" onfocus="this.b lur()">
    <input name="query" type="text" class="form" value="" size="30">
    <input type="submit" value="Search" class="form">
    <input type="hidden" name="user" value="abc">
    <input type="hidden" name="basehref" value="http://www.abc.com">
    <input type="hidden" name="template" value="default" ></td>
    </form>

    What am I doing wrong?
  • RobB

    #2
    Re: Simple Question

    Senraba wrote:[color=blue]
    > I would like to have a 600 X 400 window open with search results from
    > CPanel's Entropy Search form.
    >
    > I have the following in the <HEAD> tag:
    >
    > <script language="javas cript" type="text/javascript">
    > <!--
    > var win=null;
    > function NewWindow(mypag e,myname,w,h,sc roll,pos){
    >[/color]
    if(pos=="random "){LeftPosition =(screen.width) ?Math.floor(Mat h.random()*(scr een.width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen.heigh t-h)-75)):100;}[color=blue]
    >[/color]
    if(pos=="center "){LeftPosition =(screen.width) ?(screen.width-w)/2:100;TopPositi on=(screen.heig ht)?(screen.hei ght-h)/2:100;}[color=blue]
    > else if((pos!="cente r" && pos!="random") ||
    > pos==null){Left Position=0;TopP osition=20}
    >[/color]
    settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ ',scrollbars='+ scroll+',locati on=no,directori es=no,status=no ,menubar=no,too lbar=no,resizab le=no';[color=blue]
    > win=window.open (mypage,myname, settings);}
    > // -->
    > </script>
    >
    > I have the following <FORM>:
    >
    > <form action="/cgi-sys/entropysearch.c gi"
    > onSubmit="NewWi ndow(this,'join ','600','400',' no','center');r eturn
    > false" onfocus="this.b lur()">
    > <input name="query" type="text" class="form" value="" size="30">
    > <input type="submit" value="Search" class="form">
    > <input type="hidden" name="user" value="abc">
    > <input type="hidden" name="basehref" value="http://www.abc.com">
    > <input type="hidden" name="template" value="default" ></td>
    > </form>
    >
    > What am I doing wrong?[/color]

    All this does:
    [color=blue]
    > onSubmit="NewWi ndow(this <-------[/color]

    ....is pass the Form object to the function (not exactly a url). Nice
    try, anyway. You'll need to add an HTML TARGET name to that form tag,
    open up a blank ('about:blank') url in the pop-up, and make sure that
    'myname' matches the target name in the form tag. Get rid of that
    'return false;' as well, if you want the form to submit. Window opens
    with blank document, form submits, action page is targeted to pop-up by
    name. Simple.

    Comment

    • Grant Wagner

      #3
      Re: Simple Question

      "Senraba" <senraba@gmail. com> wrote in message
      news:e16be27b.0 412191322.2af22 ae1@posting.goo gle.com...[color=blue]
      >
      > What am I doing wrong?[/color]

      What you are doing wrong is you have not explained what behaviour you
      are seeing, what behaviour you are expecting, and how the two differ.
      You have not explained if the problem seems to be related to all Web
      browsers or only one specific Web browser. You are also writing
      incredibly cryptic code by putting too much code on one line (which also
      causes wordwraps in a lot of newsreaders, making it that much more
      difficult to debug your code).

      --
      Grant Wagner <gwagner@agrico reunited.com>
      comp.lang.javas cript FAQ - http://jibbering.com/faq


      Comment

      Working...