Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder RexxCrow's Avatar
    Join Date
    Jul 2006
    Location
    California
    Posts
    275
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Guidence with setting a form to update two different URL's

    I am posting this here because I am thinking it would require JS to do this or some form of XML, though am just guessing.

    Ok, I came up with this idea that I think is pretty neat the other day, so I am now attempting to do a project that entails using one browser window to display two different URL's, (I am thinking of using two iframes one on the left and one on floated to the right both 50% width and 80% height under these I am planning to set a form that includes last name and first name fields in the lower 20%.)

    Then I am planning to use mouseover/out's to change the width to 100% whenever one of the loaded URL's is moused over then have it change back to 50% when the mouse is returned to the lower 20% of the screen or if a mouse button is double-clicked (or right clicked?) and visa versa.

    I am also wanting to include an auto refresh function for both of the loaded URL's within the iframes that would be set to reload every 15 minutes and have the timer reset upon each new query.


    In a nutshell though using forms are new to me and am wondering if/how you:

    a. have the queries sent off to two different URL's; and
    b. have a those results loaded a given iframe rather then the same window or a new window.

    TIA

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Are the documents that are in the iframe from the same domain? If so, you can just use setInterval to reload the location.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Regular Coder RexxCrow's Avatar
    Join Date
    Jul 2006
    Location
    California
    Posts
    275
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Oh no they are from two different sites neither of which I have access to, I have the GUI portion all setup now and have since run into several issues such as: one of the sites uses VBscript rendering it nonfunctional (except in IE) and when I am in IE it overtakes control of the framed window thus making my attempt feeble, it seems that FF is able to keep the framing in place, but because of the VBscript I am unable to do anything; the other one gives me a password error when I try to login, except in FF but I am not able to use the menu in FF because of the same reason I think (they were poorly written).

    Which form of XML would I use to send my fields to the remote server, what I am thinking is for it to function like the search engine bar does in FF, you type in a first and last name hit enter and send it off to the server, except (I need to do it for two servers) and then it returns the results, but I am wanting one to go into a left iframe and the other in a right iframe... I was thinking of using a javascript:function as the action in the form on the framed page, I figure that would permit the queries to be sent off through the use of XML-something. thx.

  • #4
    Regular Coder RexxCrow's Avatar
    Join Date
    Jul 2006
    Location
    California
    Posts
    275
    Thanks
    6
    Thanked 2 Times in 2 Posts
    This is what I have so far:



    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html><head>
    <title>Automated Wants Intelligence Query v1.0 - AWIQ</title><script language="javascript" type="text/javascript"><!--
    function zin(swap){
    var chkV=document.getElementById(swap)
    if(swap=='SN'){
     document.getElementById('SN').style.width='100%'
     document.getElementById('HS').style.width='0%'
     }else{
     document.getElementById('HS').style.width='100%'
     document.getElementById('SN').style.width='0%'
     }
     document.getElementById('base').style.display='none'
    }
    function zout(swap){
     document.getElementById('SN').style.width='50%'
     document.getElementById('HS').style.width='50%'
     document.getElementById('base').style.display='block'
    }
    function process(){
    // pass fields for processing on remote server...XML based?
    
    
    }
    //--></script><style tyle="text/css"><!--
    *{margin:0px;padding:0px}
    body{white-space:nowrap;margin-left:auto;margin-right:auto;background-color:#4169E1;text-align:center;color:#F5F5F5;font-family:Arial;font-weight:bold;font-size:12px;}
    fieldset{padding:5px}
    form{vertical-align:middle}
    iframe{display:inline}
    input{background-color:#000099;color:#F5F5F5;font-weight:bold}
    #base{margin-left:auto;margin-right:auto;position:absolute;left:16%;bottom:0%;background-color:#4169E1;border:5px outset #000066;width:650px;padding:10px;margin:10px}
    #wrap{margin-left:auto;margin-right:auto}
    #HS{height:550px;width:50%}
    #SN{height:550px;width:50%}
    .css{background-color:#000099;font-family:Arial;font-weight:bold;border:1px ridge #B0C4DE;padding:2px 5px}
    .g{color:lime}
    .p{color:#FFFF00}
    .hl{filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);-moz-opacity:1}
    .hl:hover{filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);-moz-opacity:0.5}
    //--></style></head><body><div id="wrap">
    <iframe id="HS" src="http://left site" scrolling="auto" frameborder="1" marginheight="0" marginwidth="0" onMouseOver="zin('HS')" onMouseOut="zout('HS')"></iframe>
    <iframe id="SN" src="https://-right site" scrolling="auto" frameborder="1" marginheight="0" marginwidth="0" onMouseOver="zin('SN')" onMouseOut="zout('SN')"></iframe>
    <br clear="all" />
    <div id="base">
    <form action="javascript:process('ln','fn')" method="post">
    Last Name:&nbsp;<input type="text" name="ln" width="50" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First Name:&nbsp;<input type="text" name="fn" width="50" /><br /><br />
    <input class="css hl p" type="reset" value="Purge" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="css hl g" type="submit" value="Submit" />
    </form>
    </div>
    </div>
    </body></html>

    I was wanting to include an onclick or onmousedown function in the two main iframes that would like the view at 100% and then toggle it back to 50% if was already locked, but it does not seem those work within iframes, so I am not seeing that feature being able to work as of now.

  • #5
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    You really are very limited to what you can do if the iframe source comes from another domain. This is to prevent people from stealing content as their own, attacking a site using cross-site scripting exploits, or transforming the content for malicious purposes (phishing).

    You can send a request to the site and grab the results, but if you want to change the results that come back, you'll have to do this using pure script (usually server-side) to make the request and actually transform it in a string form and output the string as html. Not an iframe solution.

    I wouldn't recommend doing that, personally, if the site owner finds out, they may have legal recource to stop you from doing that. It's a form of theft of services. If the site offers an API, use that. Otherwise, this is probably not a good thing to do.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #6
    Regular Coder RexxCrow's Avatar
    Join Date
    Jul 2006
    Location
    California
    Posts
    275
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Thanks for the reply... Basically, I am just wanting to have to fill out the fields only once (locally at the bottom of the main browsers window, the first name and last name) by manually typing that in and then sending that off to both of the different servers and have those put into the correct last name and first name fields and then CR it and have the results queried back into the two iframes, this is only to make it so the user only has to type the name in once rather then twice, then later on I was planning on the possiblity of making another database for a related task and include that as a third query within the function. I don't want to change anything only make it easier to perform the task of quering the information... I was also thinking that VBscript allowed the passing of Windows program data to a URL in the same manner (from what I understand about VBscript so far), but was thinking that was would be something for later if it is even possible to do, maybe I am misunderstanding the capability of VBscript, but thought that was the only real advantage there was to using it.

    I was thinking this would work just like a spam bot does or like how Firefox works when you type information into one of the toolbar search engines for an semi-automated-query on the WBM, Wikipedia, Merriam-Websters Dictionary, Google, etc. You type it into the field, hit enter, and the results are brought up in the same window, except in this case it would be iframes and two queries would be send off for the same purpose.

  • #7
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Code that executes in a trusted environment, such as an installed browser toolbar, gets to do neat things that client-side javascript running from a website doesn't get to do.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •