HTML - Url As A Variable
Hello,
I am going to make an Iframe. The URL that shows inside the Iframe has to change with the click of a button. So as defult, it displays www.1.com when i click on the button '2' on the webpage (not inside the iframe) the Iframe then displays www.2.com the same for buttons 3 4 5 etc. how can i do this? i was thinking of having the URL the iframe goes to as a variable, and changing the variable each time i click on one of the buttons? Help please ^_^ thanks. Similar TutorialsI'm new to all this stuff, but I am working on creating a simple drop-down menu that must pass a variable to an xml script (VXML to be exact). All files will be on a linux web host. Any suggestions on what to use for the drop-down menu web page (php, java script, etc)? Depending on what selection is chosen in the drop down, a different value need to be assigned to the variable. Thanks! Hey guys, new to the forum.. I'd like to have a text box on my website where users can put in a "number" and click submit. That would then open a new window with a URL that includes that number. i.e. "http://mywebsite.com/something.cgi?number=" Is this possible? I'm not sure how to get a form to accept the text box as the variable to open the URL. At this moment I am making a 'website' which shows embedded docx, doc, pfd, ppt or pptx files, using the google docs viewer. This works great, but of course I have a problem. The files on the server have one NONE variable part in the name, and the other parts are variable. So an example: firstfile_001.pdf firstfile_001.docx first_001_abc.pptx So the files can have 3 variable parts in it: *_001_*.* But only one of the files is present. So if there is a 001_*.pdf, there is no 001_*.doc. Is there a way to adobt to this variable urls? (PHP is not an option because it is not supported by the server. I cannot change anything on the server (i.e., get an other server or so.)) Hi, I can't get the variable E to print at the end by the form answer. It is calculating cubic inches, then the Answer is to gallons. I want to see both answers. Thanks in advance!! Code follows: <HTML> <HEAD> <TITLE>Calculation</TITLE> <SCRIPT LANGUAGE="JavaScript"> function CalculateSum(Atext, Btext, Ctext, Dtext, form) { var A = parseFloat(Atext); var B = parseFloat(Btext); var C = parseFloat(Ctext); var D = parseFloat(Dtext); var E = (A*C*D) + ((A/2) * (B-C)*D); form.Answer.value = E/200 ; } /* ClearForm: this function has 1 argument: form. It clears the input and answer fields on the form. It needs to know the names of the INPUT elements in order to do this. */ function ClearForm(form) { form.input_A.value = ""; form.input_B.value = ""; form.input_C.value = ""; form.input_D.value = ""; form.input_E.value = ""; form.Answer.value = ""; } // end of JavaScript functions --> </SCRIPT> </HEAD> <BODY> <P><FONT SIZE="+2">Calculation</FONT></P> <FORM NAME="Calculator" METHOD="post"> <P>Enter A: <INPUT TYPE=TEXT NAME="input_A" SIZE=10></P> <P>Enter B: <INPUT TYPE=TEXT NAME="input_B" SIZE=10></P> <P>Enter C: <INPUT TYPE=TEXT NAME="input_C" SIZE=10></P> <P>Enter D: <INPUT TYPE=TEXT NAME="input_D" SIZE=10></P> <P><INPUT TYPE="button" VALUE="CALCULATE" name="AddButton" onClick="CalculateSum(this.form.input_A.value, this.form.input_B.value, this.form.input_C.value, this.form.input_D.value, this.form )"></P> <P><INPUT TYPE="button" VALUE="Clear Fields" name="ClearButton" onClick="ClearForm(this.form)"></P> <P>Cubic Inches = <script type="text/javascript"> document.write(E); </script> <br> Gallons =<INPUT TYPE=TEXT NAME="Answer" SIZE=12> </P> </FORM> </BODY> </HTML> For my layout I've got a div content and several others inside it. HTML Code: <div id="content"> <div id="box1"> <h1>Portfolio</h1> </div> <div id="port"> sample text </div> <div id="port"> sample text </div> </div> And that's the css for it Code: #content { float: right; width: 540px; margin-right: 40px; margin-top: 20px; height: 100%; } What goes inside the div "content" varies for each page, so I want to make the content with variable height, but I can't! When I preview the page its shows the "content" being overlapped by what's inside it. It may be something very simple (still learning) but I can't see what is wrong. Can someone help please? Many thanks! I have an embedded flash element and calls on a URL for it's content. Code: <embed flashvars="www.url.com"........> The URL I need I have as a variable in some javascript in the header. How can I set flashvars to be the variable I need? Hi all, i'm new to xml but i was wondering if the following is possible: I have a html document with some tabs. And when i click on a tab it opens a xml document. In the xml document is a link to xsl sheet with a variable and i want to change that variable with the value of the link in html document. Does some one nows how? html link: <a href="#t1" target= "t1" title="[link title]">11</a> <div class="sliderkit-news" id=t1><iframe name="t1" width="100%" height="800" src=wo.xml></iframe> xml variable <xsl:variable name= "line" select="'11'"/> The number 11 should come form the a href in the html doc. Also the following is possible fill the variable with a drop down menu: <xsl:variable name= "line"> <select> <option value="'11'">11</option> <option value="'12'">12</option> <option value="'13'">13</option> </select> </xsl:variable> I want to fill the variable with a drop down selection. and then use the variable in the document. What i do is opening the xml en then it generates a display based on the xsl sheet. i hope some one can help me. Hi folks - right then, think im being thick here lol <input type="hidden" name="amount" value="myvariable2"> I have a variable say called myvariable1, how do I pass that into the above so that value becomes equal to it? ie myvariable2 = myvariable1 myariable2 also needs to be/become numeric. Any help appreciated, ta karl Hi Can someone help or advise me I am after a piece of code that will show a search box, which will display two different results depending on what is entered into the search. If someone was to enter one of my selected keywords a successful message appears. But if any other word is enter a nun-successful message appears. I think what i am after is some kind of "form"?? but have search lots of sites with little success. The search does Not need to email or add information to any files, just dispaly a succsessfull or un-successful message result. thanks I need to pass a variable from a form to my url. here is the html: Code: <form action="gdform.asp" method="post" id="form1"> Would you like to be notified of coming promotions?<br /> <label for="radiobutton">Yes</label> <input name="_Send_Promos" type="radio" value="radiobutton"id="contactYes" /> <label for="label">No</label> <input name="_No Promos" type="radio" value="radiobutton" id="contactNo" /> <br /> <br /> <input type="text" name="_Name" size="40" maxlength="42" /> <br /> <input type="text" name="_Company" size="40" maxlength="42" /> <br /> <input type="text" id="_Email" name="_Email" size="40" maxlength="42" /> <br /> <input type="text" name="_Phone" size="40" maxlength="42" /> <input name="submit" type="submit" value="Send" onclick="getEmail()" /> <input name="reset" type="reset" value="Clear" /> </form> now here is my java: Code: <script type="text/javascript"> function getEmail() { alert("alert"); var emailAddress if(document.form1._Send_Promos.checked == true) { emailAddress = document.getElementById("_Email").value; document.write('<input type="hidden" name="redirect" value="http://www.myalbano.com/thankyou.aspx?EmailAddress="'+ emailAddress'">"'); } else { document.write('<input type="hidden" name="redirect" value="http://www.myalbano.com/thankyou.aspx"'); } } </script> problem is that the javascript never gets executed. I do not get the alert. I have put it at the top, in the html, and at the bottom of the page. None has worked. what is it that I need to do to get the html to see the java? Hi all... i am using the following HTML to load a flash video on a iweb page. Is there a way i create links on my page to different flash files on my web server and have it play that video? I would think i have to set the 'embed src' and 'value' to a variable that's changed every time a new link is clicked on the page but how do i setup up that variable? <object classid="clsid27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/ flash/swflash.cab#version=6,0,40,0" border="0" width="800" height="600"><param name="movie" value="http://web.mac.com/youriDisk/docs/flash.swf"><param name="quality" value="High"><embed src="http://web.mac.com/youridisk/docs/flash.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="800" height="600"></object> I have a basic horizontal iframe with a persistent navigation header and a content page below which is the target for the navigation. How do you set the height of the content frame to scroll if necessary depending on the amount of content on the page? The content pages that are swapped in/out and have varying heights. I would like the page height overall to include all content. Setting scrolling to "yes" in the <iframe> tag forces the content (framed) page height to about 100px(?), leaving a lot of dead space in the browser window below. Ideally the whole page would scroll as one, but I would settle for scrolling just the content (framed) page. Any help would be appreciated. Thx Hi! I would like to know how do I pass a variable in my URL to the next page. HTML Code: For example, my URL is: http://www.mysite.com?source=google I'm using this form code to go to the next page: <form action="http://www.mysite.com/next-page.html" method="get" name="form"> <input type="text" name="zipcode" maxlength="5" id="zipcode" /> <br /> <input type="submit" id="button" value="Go"/> </form> So the next page URL will be: http://www.mysite.com/next-page.html?zipcode=11111 I want that the variable "google" will be also in this URL: http://www.mysite.com/next-page.html?zipcode=11111&source=google How I do that? Thanks, Steve Can the initial value of a text field be a variable described by javascript? If so, please tell me how. Hi all -- I have a bit of an issue with something I need to do involving variable width. Perhaps it is more of a logic problem than a coding one, but I need somebody to talk to about it, and figured this would be the best place. I'm currently pulling in an ASP include file -- a file I do not have access to -- as my header. That include file is designed to expand to 100% of the page; however, we're looking to mix and match some things, and I've discovered that I can control the width of it by putting DIV tags around it. That's the good news. The issue is this, though... I can't fix the header at a certain width, because we'd like the ability for variable page widths up to 1024x768 resolution. In other words, if I lock it in at 1024, then people with 800x600 resolution will see a horizontal scrollbar. And we don't want that. So, I guess my question is: How do I build a page with variable width up to and including 1024x768 resolution, but no more? Any suggestions would be much appreciated! I have tried to use a variable in mailto: in order to protect my email address from spammers. Am I doing something wrong or is it simply not possible? $info="my@email.com"; /*email address is stored in email.inc and is moved to the script with the include() statement.*/ $recipients = '$info'; I have a webpage that has about 100 links on it. All of them point to the same 900+ page document, but go to a different page. This document changes, so that a page may get added prior to a certain page. because of that, I'd prefer not to have to hardcode each of the 100 page numbers. I'd like to have a rolling reference page, so that if the first link started on page 150, and the second link would go to page 155, then I'd like for it to be #page=var1+5. Here is the hardcoded version that I've started creating: <a href="http://.../PDF_file.pdf#page=155">O15_test_setup .... page 5-16</a> the #page=155 would be indicative of the second link above. I'd like to set up an array that i can use in the href tag for each of these links, that will allow me to goto the correct page. and if a page gets added, then it would only take one change to update the file. I've also looked for a way to open the PDF file, and search for the "O15_test_setup" text, but haven't found a way to do that. My thought of how it could be done is with javascript, declare the array, and fill in the array. Something like array(1,1) = first link text (http://...pdf_file.pdf#page=150) array(1,2) = first link displaytext (O14_test_setup) array(2,1) = second link text (http://...pdf_file.pdf#page=155) array(2,2) = first link displaytext (O15_test_setup) Then in the HTML part of the file, have something like <a href = array(1,1);array(2,1)> What is the correct way to do this? Is there a way to center images of changing size, without using the <div align="center">? I have several images that I would like to center on a page with having to compute where the center is and then setting the margin to move it over. Thanks, Greg Hi, I have a PHP script I am writing which displays a list of all the news posts I have made on my site and to the right of it has two links, Edit and Delete. The script will iterate through all the news posts I have made and display them down the page from most recent to oldest, it looks like this: The way it works at the moment is that when each headline gets added, the script will set the edit link for that particular post to <a href="EditSelectedPost.php?$i">Edit</a> $i being the ID to that post. I want it so that when I get sent to EditSelectedPost.php I can pluck off the value of $i and use it on that page. I want to be able to do this without using forms or buttons. Can this be done? Any help will be greatly appreciated. Thanks Ashman Hi All, I am new to html programming. I am having problem in sharing a variable between 3 html pages. I tried googling for the solution but couldn't get the right one. A brief about my problem is... 1. I have 3 html pages, 1.htm, 2.htm & 3.htm 2. I have a variable var1 in 1.htm which is set to 0. 3. 1.htm will open 2.htm and 3.htm 4. 3.htm will update the var1 variable declared in 1.htm to 1 on onunload event. 5. 2.htm will check the status of var1 for value 1, if yes it will navigate to next page. I have pasted the code below for 1.htm, 2.htm & 3.htm respectively. Can anyone please help me in this regard. Thanks in advance. Regards, tux09. ---------------------------------------------------------------- 1.htm -------- <html> <head> <title>main</title> <script type="text/javascript"> var checkPopUpClosed = 0; function delayed_redirect(){ window.open('3.htm','SaveAs','height=250,width=640,resizable=0,directions=0,location=0,toolbar=0,men ubar=0,scrollbars=0'); } </script> </head> <body ><!-- masthead --> <table border="0" cellpadding="0" cellspacing="0" summary="."> <tr><td ><h1>Main</h1></td></tr> </table> <FORM method="post" name="mainForm" ACTION="2.htm"> <table cellspacing="0" cellpadding="0" border="0" summary="." > <tr> <td class="rightContentPane"> <br><br> <div class="pad10"> <div> <INPUT type="submit" name="Back" accesskey="b" alt="Back" VALUE="< Back"> <INPUT type="submit" name="Finish" accesskey="s" alt="Save As" onclick="javascript:delayed_redirect();" VALUE="Save As"> <INPUT type="submit" name="Cancel" accesskey="c" alt="Cancel" VALUE="Cancel"> </div> </td> </tr> </table> <div> <INPUT type="hidden" name="Hide" VALUE="18489"> <INPUT type="hidden" name="shVariable" VALUE="0"> </div> </FORM> </div> </body> </html> ---------------------------------------------------------------------------------------- 2.htm -------- <html> <head> <title>second</title> <meta http-equiv="refresh" content="5;" /> <script type="text/javascript"> //if (1 == document.mainForm.checkPopUpClosed.value) var temp = 0; if (1 == top.mainForm.checkPopUpClosed) alert("Close received = ");//+document.mainForm.checkPopUpClosed.value); function checkClick() { //temp = top.parent.item.forms("mainForm","checkPopUpClosed"); //temp = parseInt(parent.checkPopUpClosed);//.document.frames.item("shVariable"); //temp = document.getElementById("mainForm"); //temp.parentElement(shVariable); //temp = document.mainForm.checkPopUpClosed.value; alert("temp = "+temp); } </script> </head> <body onclick="checkClick();"><!-- masthead --> <tr><td ><h1>Second</h1></td></tr> <FORM method="post" name="secondForm" > <table cellspacing="0" cellpadding="0" border="0" summary="." > <tr> <td > <div > <table width="200" border="3" cellspacing="0" cellpadding="0" summary="."> <tr> <td style="text-align:center;"> <br/> <h3>Result</h3> <br/> In progress. <br/><br/><br/> </td> </tr> </table> </div> </td> </tr> </table> </FORM> </div> </body> </html> ------------------------------------------------------------------------------- 3.htm -------- <html> <head> <title>third</title> <script type="text/javascript"> function doClose(){ if (window.opener && !window.opener.closed) { window.opener.location.href="1.htm"; } } function delayed_close() { setTimeout("window.close();",7000); } function delayed_Openclose() { delayed_close(); setTimeout ("doClose();", 6900); } function doAbnormal_Close() { var temp2 = 0;// = document.getElementById("mainForm"); top.mainForm.checkPopUpClosed = 1; temp2 = top.mainForm.checkPopUpClosed; //temp2 = open.document.forms("mainForm", "0").checkPopUpClosed = 1; //temp2 = document.getElementById("mainForm").checkPopUpClosed.value; alert("temp2 = "+temp2); //alert("checkPopUpClosed 1 = "+top.mainForm.checkPopUpClosed); //document.mainForm.checkPopUpClosed.value = true; //alert("checkPopUpClosed 2 = "+document.mainForm.checkPopUpClosed); } function checkClick() { var temp3 = 0; //temp3 = if(window.opener.closed); alert("temp3 = "+temp3); } </script> </head> <body onunload="doAbnormal_Close();" onclick="checkClick();"> <FORM method="post" name="thirdForm" ACTION="2.htm"> <table cellspacing="0" cellpadding="0" summary="."> <tr> <td style="text-align:center;"> <br /><br /> <h3>Checking</h3> <br /><br /> To submit this request click "Save As" <br /><br /> <INPUT type="submit" name="Save" accesskey="s" alt="ok" onclick="javascript:delayed_close();" VALUE="Save As"> <br /><br /> </td> </tr> </table> </FORM> <script type="text/javascript"> </script> </body> </html> --------------------------------------------------------------------------------------------- |