JavaScript - Creating Redirection Url From Form
I'm a non-web programmer being forced to do some web programming.
My immediate problem is that, on submission of a form, I need to be able to open a url (that I control) with the filled-in form values appended to the new url. In other words, I need to be able to do the equivalent of : Code: <form> <input name="key1" type="text"/> <input name="key2" type="text"/> <input type="button" value="Submit" onclick="window.open('http://new.domain.com/newpage.html?key1=val1&key2=val2')"/> </form> I would really like to do this without server-side code. Pointers? TIA Similar Tutorialshello, I am trying to figure out how to hide the direction page in this code: I want to hide: www.ipage.com/mail/index.bml <INPUT TYPE="submit" NAME="Log In" VALUE="Check Mail" onclick="javascript:login.action='http://www.ipage.com/mail/index.bml?s=1';javascript:login.destination.value = '/mailadmin/index.bml?check=1';" > </TD> <TD> <INPUT TYPE="submit" NAME="Log In" VALUE="Manage Mail" onclick="javascript:login.action='https://secure.ipage.com/mailLogin';javascript:login.destination.value = '/mailadmin/index.bml?manage=1';"> any help is appreciated.... Hello all! As it could not be otherwise, in my first post here, I have a horribly simple problem... I'm currently working on a homepage for my browser, where I have many frequently used links, and I'm trying to implement some search engines too. The one I'm working on is simply, a predefined URL, and the input text string at the end. For example: "http://www.example.com/search/(textinput)" This is the code I have so far: Code: <script type="text/javascript"> function gosearch() { var srchstring = document.getElementById('string').value; var resulturl = 'http://www.example.com/search/' + srchstring; window.location.href = resulturl; } </script> <form name="searchform" onsubmit="gosearch();"> <input id="string" size="31" maxlength="255" value="" /> <input type="submit" value="Search!" /> </form> But what happens by using this code, is that, to the current URL, a "?" gets added, as if the code tried to send some info using GET. I could do this quite easily using PHP, but as I want to use this locally, I cannot use any server-side code... Besides the fact that I want to learn some JScript too. Thanks for your help. Hello. My goal is for the user's input on their first visit to redirect their landing page in the future. I am a novice and any help is very much appreciated. The form's drop down menu includes three cities (Calgary, Toronto, Vancouver). When the user presses "submit form", the script should create a cookie to store the user's city selection. Next time the user visits the site, they should be redirected to their city's site, ie. "/vancouver.html" Right now, the code is returning an error from the onload("redirect();") function. The error indicates I am trying to redirect to "/[object HTMLSelectElement].html", but I am not sure if the trouble is in reading or writing the cookie. For simplicity, I've removed most of the other content from this page (my cookie.js is attached as a .doc): Code: <title>Site Title</title> <script type="text/javascript" src="cookie.js"></script> <script language="JavaScript" type="text/javascript"> function redirect() { userCity = readCookie ("user_city"); if (userCity) { window.location.replace(userCity + ".html"); } else { window.location.replace("index.html"); } } function setCity(box) { { var userCity =(document.welcomeSignUp.userCity); for (i=0; i<userCity.length; i++) { if (userCity[i].name != box.name) { userCity[i].selectedIndex = 0; } } } writeCookie("user_city", userCity, 5 * 365); } </script> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <form id="welcomeSignUp" action="" method="get" name="welcomeSignUp" onload="redirect();"> Your Email address: <input type="text" name="email" value="" size ="20" /> <br /> Choose Your City: <select name="userCity" size="20"> <option value="one">Calgary</option> <option value="two">Toronto</option> <option value="three">Vancouver</option> </select> <a href="index.html"><button class="rounded" onclick="setCity(this);"> <span>submit form</span> </button></a> </form> </body> </html> I have a form in an iframe that submits nicely. Here is one of the hidden fields that gives the page to redirect to after submitting the form: Code: <input type="hidden" name="rtrn" value="http://www.domain.com/thanks.html" target="_parent"> The parent target doesn't work, does anyone know how I get the thanks page to replace the page containing the iframe? Hi every one Following is the situation I want a solution for, -I have a form whose contents are forwarded to a mailer program hosted on a server which sends out emails. So basically the form data is submitted to one Mailer page (I have no control over the mailer program). -After the form has been submitted the mailer program redirects to a default page or the "return " page specified by me..again redirects no matter what I have no control over it... -Now instead of being redirected to a page I want the form contents to be submitted to another php page which will appear after the form has been submitted to the mailer page and display the contents of the form originally submitted. Basically I want to submit to 2 different pages I know thats possible but I do not know how to get around the redirection from mailer page. I thought of having the second php page to be the redirect page with all form data sent in query string however data fields are too many to send over get. Is there anyway around this in javascript? Its very complex to explain..I hope some one can help I hope following crude visualisation helps currently submit form to------------->Mailer page (It redirects to any page specified) form to | | |------->Page2.php (Want this to appear after form has been submitted to mailer page but mailer page redirects..) Regards, Aditya I am no javascript expert, very much a beginner. I am trying to incorporate some into a web-based form. The problem is the button I created to add extra fields does not work, and I can't find exactly where the problem is. I'm in need of some help from a javascript guru. Help me enjoy my Friday afternoon by solving this! The javascript is mostly borrowed and slightly altered, the "additem" I wrote myself so that is probably where the problem lies! Here is the html: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/> <title></title> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> <link rel="stylesheet" type="text/css" href="style.css"/> <script type="text/javascript"> function showAsset(id,str) { if (str=="") { document.getElementById("assetinfo"+id).innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("assetinfo"+id).innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getasset.php?q="+str,true); xmlhttp.send(); } var noFields = "5"; function additem() { var fieldrow = document.createElement('tr'); var fieldcolumn1 = document.createElement('td'); var fieldinput = document.createElement('input'); fieldinput.name = "asset"; fieldinput.onChange = "showAsset("+noFields+",this.value)"; var fieldcolumn2 = document.createElement('td'); fieldcolumn2.id = "assetinfo"+noFields; fieldcolumn1.appendChild(fieldinput); var fieldcolumns = fieldcolumn1 + fieldcolumn2; fieldrow.appendChild(fieldcolumns); var addbefore = document.getElementById('fieldend'); document.body.insertBefore(fieldrow, addbefore); noFields = noFields++; } </script> </head> <body> <form> <table> <tr> <td><input name="asset" onChange="showAsset(1,this.value)"></td> <td id="assetinfo1"></td> </tr> <tr> <td><input name="asset" onChange="showAsset(2,this.value)"></td> <td id="assetinfo2"></td> </tr> <tr> <td><input name="asset" onChange="showAsset(3,this.value)"></td> <td id="assetinfo3"></td> </tr> <tr> <td><input name="asset" onChange="showAsset(4,this.value)"></td> <td id="assetinfo4"></td> </tr> <tr> <td><input name="asset" onChange="showAsset(5,this.value)"></td> <td id="assetinfo5"></td> </tr> <tr id="fieldend"> <td><input id="addfield" type="button" value="add item" onClick="addfield()"></td> </tr> </table> </form> </body> </html> Here is the associated getasset.php: Code: <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'root', 'root'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("assettracking", $con); $sql="SELECT * FROM assets WHERE assetID = '".$q."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo "<b>".$row['make'] ." ".$row['model'] ." - ".$row['serialnumber']."</b> | Status: ".$row['statusID']." | Comments: ".$row['comments']; } mysql_close($con); ?> Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title> Project 2 </title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="en-us" /> <link rel="stylesheet" href="../jsfiles/js_styles.css" type="text/css" /> <script type="text/javascript"> /* <![CDATA[ */ function checkForNumber(fieldValue) { var numberCheck = isNaN(fieldValue); if (numberCheck == true) { window.alert("You must enter a numeric value!"); return false; } return true; } function calculate() var shipping = 0; var total = 0; { if (document.forms[0].hand_tool.value != document.forms[0].hand_tool.value == true) (document.forms[0]item1.value == 20); { && document.forms[0].shipping.value == (shipping + 5); { && (document.forms[0].total.value = document.forms[0].hand_tool.value + document.forms[0].shipping.value) } } function confirmSubmit() { if (document.forms[0].first_name.value = "null") { window.alert("You have not entered the requested Customer Information."); return false; } else if (document.forms[0].last_name.value = "none" || document.forms[0].city.value = "" || document.forms[0].state.value = "none") { window.alert("You have not entered the requested Customer Information."); return false; } var pmntMethod = false for (var j=0; j<3; ++j) { if (document.forms[0].credit_card[j].checked == true) { pmntMethod = true; break; } } if (pmntMethod != true) { window.alert("You must select a method of payment."); return false; } return true; } function confirmReset() { var resetForm = window.confirm("Are you sure you want to reset the form?"); if (resetForm == true) return true; return false; } /* ]]> */ </script> </head> <body> <!-- Your XHTML here --> <h1>Purchase Order</h1> <form action="FormProcessor.html" method="get" enctype="application/x-www-form-urlencoded" onsubmit="return confirmSubmit();" onreset="return confirmReset();"> <h3>Products</h3> <table> <tr> <td> <p>Hand Tools <br />$20.00<img src="handtools.gif" alt="Hand Tools" class="img" /></p> </td> <td> <select name="hand_tool" size="1"> <option value="hand_tool">Hand Tool</option> <option value="saw">Saw</option> <option value="hammer">Hammer</option> <option value="screwdriver">Screwdriver</option> <option value="wrench">Wrench</option> <option value="pliers">Pliers</option> </select> </td> <td> <p>Power Tools <br />$30.00<img src="powertools.gif" alt="Power Tools" class="img" /></p> </td> <td> <select name="power_tool" size="1"> <option value="power_tool">Power Tool</option> <option value="circular_saw">Circular Saw</option> <option value="sabre_saw">Sabre Saw</option> <option value="drill">Drill</option> <option value="belt_sander">Belt Sander</option> <option value="table_saw">Table Saw</option> </select> </td> </tr> </table> <h3>Shipping Fees</h3> <table> <tr> <td>Item 1: <input type="text" name="item1" value="" onchange="calculate();" /></td> <td>Item 2: <input type="text" name="itme2" value="" onchange="calculate()" /></td> </tr> <tr> <td>Shipping: <input type="text" name="shipping" value="" /></td> <td>Total: <input type="text" name="total" value="" /></td> </tr> </table> <h3>Customer Information</h3> <p>First Name <input type="text" name="first_name" value="FirstName" onclick="document.forms[0].first_name.value = '';" onchange="confirmSubmit();"/> Last Name <input type="text" name="last_name" value="LastName" onclick="document.forms[0].last_name.value = '';" onchange="confirmSubmit();" /></p> <p>Street Address 1 <input type="text" name="address1" value="Address1" onclick="document.forms[0].address1.value = '';" onchange="confirmSubmit();" /></p> <p>City <input type="text" name="city" value="City" onclick="document.forms[0].city.value = '';" onchange="confirmSubmit();" /> State <input type="text" name="state" value="State" onclick="document.forms[0].state.value = '';" onchange="confirmSubmit();" /> Zip <input type="text" name="zip" value="Zip" onchange="return checkForNumber(this.value);" onclick="document.forms[0].zip.value = '';" /></p> <p>Phone <input type="text" name="phone" value="Phone" onchange="return checkForNumber(this.value);" onclick="document.forms[0].phone.value = '';" /> Fax <input type="text" name="fax" value="Fax" onclick="document.forms[0].fax.value = '';" onchange="return checkForNumber(this.value);" /></p> <p>Payment Method? <input type="radio" name="credit_card" />Visa <input type="radio" name="credit_card" />MasterCard <input type="radio" name="credit_card" />American Express</p> <p>Credit Card Number<input type="text" name="cardNumber" value="CardNumber" size="50" onclick="document.forms[0].cardNumber.value = '';" onchange="return checkForNumber(this.value);" /></p> <table> <tr> <td> <p>Expiration Month</p> </td> <td> <select name="month" size="1" style="width: 200px"> <option value="months">Month</option> <option value="january">January</option> <option value="february">February</option> <option value="march">March</option> <option value="april">April</option> <option value="may">May</option> <option value="june">June</option> <option value="july">July</option> <option value="august">August</option> <option value="september">September</option> <option value="october">October</option> <option value="november">November</option> <option value="december">December</option> </select> </td> <td> <p>Expiration Year</p> </td> <td> <select name="expiration" size="1"> <option value="2009">2009</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> <option value="2013">2013</option> <option value="2014">2014</option> </select> </td> </tr> </table> <p><input type="image" alt="Graphical image of a submit button" src="submit.gif" onchange="confirmSubmit()" /></p> <p><input type="reset" value="Reset Purchase Order Form" onchange="confirmReset();" /></p> </form> <!-- your XHTML validation icon--> <p> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" style="border: 0px;" /></a> <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img src="http://www.austincc.edu/jscholl/images/vcss.png" alt="Valid CSS!" height="31" width="88" style="border: 0px;" /></a> </p> </body> </html> Hi, Im looking to make a payment form that calculates the prices as you go along, similar to this i just dont know how to go about it, is there software that can be used? thanks alot, Dan Hi, I'm trying to automatically generate a new <option> tag in a html form using the below code, but it's not working. Does anyone have any ideas? The get_lightboxes function is being called via the add_to_lightbox functon. Javascript: function get_lightboxes(title, new_lightbox_id){ var new_option = document.createElement('option'); new_option.text = title; new_option.value = new_lightbox_id; var select_box = document.getElementByID('lightbox_select'); try { select_box.add(new_option, null); } catch(ex) { select_box.add(new_option); } } HTML: <form method="post" action="<?=$_SERVER['PHP_SELF']?>" name="lightbox_form" onsubmit="add_to_lightbox('<?=$_GET['id']?>', '<?=$_GET['media_urn']?>', lightbox_select_<?=$_GET['id']?>.value); return false;"> <input type="hidden" name="submitted" value="1" /> <input type="hidden" name="user_email_<?=$_GET['id']?>" value="<?=$_GET['user_email']?>" /> <input type="hidden" name="record_id_<?=$_GET['id']?>" value="<?=$_GET['id']?>" /> <input type="hidden" name="media_urn_<?=$_GET['id']?>" value="<?=$_GET['media_urn']?>" /> <h2>Add/Delete from existing lightbox:</h2> <p> <select name="lightbox_select_<?=$_GET['id']?>" id="lightbox_select"> <? foreach ($get_lightboxes as $lightbox) : ?> <? $lightbox_id = $lightbox["lightbox_id"]; ?> <? $title = $lightbox["title"]; ?> <? if(strlen($title) > 25) $title = substr($title, 0, 25) . "…"; ?> <option value="<?=$lightbox_id?>"><?=$title?></option> <? endforeach; ?> </select> <input type="submit" name="submit" value="Add" /> </p> </form> Hi everyone, The following code has an onblur event in the input fields so that if someone clicks out of the field without typing something in it, the original label, ie. 'First name' is reinserted into the field. The field is also being validated by some php code, however the onblur event creates a problem because the form still submits even if a name isn't typed into the field. It's assuming that 'First name' is an entry and therefore isn't validating it correctly. It was suggested that on the submit event of the form, there would be a function that checks if the value is First Name then return false, but then otherwise return true. As my javascript skills are very basic, I wondered if someone could help me with this code to solve this issue? Appreciate any help. Code: <input id="firstname" name="firstname" type="text" value="First name" onfocus="if (this.value == 'First name') this.value=''" onblur="if (this.value == '') this.value='First name'" /> <?php if (ValidatedField('index_965','index_965')) { if ((strpos((",".ValidatedField("index_965","index_965").","), "," . "1" . ",") !== false || "1" == "")) { if (!(false)) { ?> <span style="color: red"> First name is required </span> <?php //WAFV_Conditional index.php index_965(1:) } } }?> Ok so problem is that I'm using an XML generated intro for my website. My intro(index.html) is in the root directory with website home(index2.html). Issue is that I want the website to be loaded directly after intro in the same browser tab/window/page instead of a new one. Intro is using XML formatting and the Javascript being used is Asual SwfAddress 2.4 deeplinking for Flash and XML. Let me post some codes here from my website and intro; Intro.xml Code: <link url="index2.html" target="_self" /> Swfaddress.js 2.4 Where targets are set Code: {target=typeof target!=UNDEFINED?target:"_self";if(target=="_self"){self.location.href=url}else{if(target=="_top"){_l.href=url}else{if(target=="_blank"){window.open(url)}else{_t.frames[target].location.href=url}}}};this.popup=function(url,name,options,handler){try{var popup=window.open(url,name,eval(options));if(typeof handler!=UNDEFINED){eval(handler)}}catch(ex){}_popup=arguments} The intro is a template I'm using and I'm not familiar to its coding. I just want the intro to end and the website to load in the same browser window but its not happening. I've used other target options like 'parent' and 'top' but its not working. Also, on intro page there is a 'skip intro' button but when you click it intro keeps on playing and new window pop opens with the website. You can preview the website at; www.caterpowertrading.com and SWFaddress 2.4 at www.caterpowertrading.com/js/swfaddress.js No, its not using AS1-3. ~ Desperate Soul. PS: Sorry for multiple postings but its actually not! here is the link that i want to redirect http://www.xyz.com/tracks?hop=martit...e=1&varname2=2 when it will redirect the URL will be http://www.xyz.com/special?varname1=1&varname2=2 it's mean the hop and redirection variable will be remove from querystring, special is a page, it will take value from redirection variable, nothing will be hardcode. Hi all Sorry my first post is a question...but I hope you can help me out all the same. My name's Steve, and I have struggled (like all heck!) to figure this scenario out. I owe you a beer if you can help! OK, here's the scenario: I'm using a very basic redirect script, such as: Code: <html> <body> <script language="javascript" type="text/javascript"> function redirect(URL) { document.location=URL; return false; } </script> <a href="http://www.mywebsite.com" onclick="return redirect('http://www.mywebsite/contactme.html');">This Works</a> </body> </html> ...nothing you haven't seen a million times, right? BUT! I'd like the page I'm redirecting to (http://www.mywebsite/contactme.html) to open up an invisible iFrame, and then redirect the "parent" URL ("http://www.mywebsite.com") to an external site... So, 1) The visitor clicks on a link on my site (say, contactme.html) 2) The visitor is redirected to another page on my site (in an invisible iFrame)...e.g. mywebsite.com/processing.html 3) The iFrame loads in another invisible iFrame (for example, http://3rdpartysite.com/updatecontact.html) 4) The visitor on the contactme.html page is then redirected to a different domain (e.g. http://3rdpartysite.com/done.html) I've spent literally WEEKS trying to get this code going, and I'm now admitting defeat! I'm sure it's possible, but JS is not my specialist subject... ...at all I'd really appreciate ANY pointers, because I have a deadline to meet! Kind regards, Steve Hi, I am wanting to install an automatic re-direction script. I have seen some pretty complicated ones and then I came across this: Code: <script type="text/javascript"> <!-- if (screen.width <= 699) { document.location = "mobile.html"; } //--> </script> Is that going to work ? Thanks . Morning Guys, i have a little issue i need to tackle and i belive Javascript is the way forward on this, so looking for some pointers/help on the idea i have in mind. so basically i have a website and its going to be selling severall products. now i have a "Global" navigation which stays the same on every page throughout the website. now obviously if this is set into the master template all the links will be the same. 1 of my links will be a "buy now" button, i want this to never need changing but i want the link to direct to the correct purchasing page depending on which product is being described in the content area... so im guessing its going to need to fetch some sort of Value/Variable out the content and then use that to redirect to the correct page via that single "buy now" button.. any ideas or input cheers, ant. I'm facing a validation error, whenever I leave any of the fields blank, it gives me a warning and then it redirects me to (index.php?option=com_ccnewsletter&view=ccnewsletter) What I wanna know is how can I freeze the page until all fields are filled? This is the javascript code: Code: <script type="text/javascript"> function formsubmit(task) { var form = document.subscribeFormModule; if(task == "addSubscriber") { if(form.name.value== "") { alert('<?php echo $parameters['namewarning']; ?>'); } else if(form.email.value == "") { alert('<?php echo $parameters['emailwarning']; ?>'); } else if(( form.email.value.search("@") == -1) || ( form.email.value.search("[.*]" ) == -1 )) { alert('<?php echo $parameters['emailwarning']; ?>'); } <?php if($parameters['showterm']) { ?> else if(form.terms_condition_ch.checked == false) { alert ('<?php echo $parameters['terms_cond_warn']; ?>'); } <?php } ?> else { form.task.value = "addSubscriber"; form.submit(); } } else if(task == "removeSubscriberByEmail") { if(form.email.value == "") { alert('<?php echo $parameters['emailwarning']; ?>'); } else if(( form.email.value.search("@") == -1) || ( form.email.value.search("[.*]" ) == -1 )) { alert('<?php echo $parameters['emailwarning']; ?>'); } else { form.task.value = "removeSubscriberByEmail"; form.submit(); } } } </script> And this is the form's code: Code: <div class="mainnewsletter"> <p><?php echo $parameters['introduction'] ?></p> <div class="module" style="padding-top: 0px;"> <div class="normalsublayout"> <form class="form-login" action="<?php echo JRoute::_('index.php?option=com_ccnewsletter&view=ccnewsletter');?>" method="post" name="subscribeFormModule" id="subscribeFormModule"> <p><div> <?php echo $parameters['name']; ?>: <div class="username-block"> <div class="input-field-l"> <input class="inputbox" type="text" onblur="if(this.value=='') this.value='YourName';" onfocus="if(this.value=='YourName') this.value='';" name="name" id="name" value="<?php echo $name; ?>" /> </div></div> </div> </p> <p> <div> <?php echo $parameters['email']; ?>: <div class="password-block"> <div class="input-field-l"> <input class="inputbox" type="text" onblur="if(this.value=='') this.value='youremail@domain.com';" onfocus="if(this.value=='youremail@domain.com') this.value='';" name="email" id="email" size="15" maxlength="35" value="<?php echo $email; ?>" /> </div> </div> </div> </p> <?php if($parameters['showterm']) { ?> <p> <input id="ccnewsletter" name="terms_condition_ch" class="inputbox" type="checkbox"> <a style="font-size:14px;color:#4E4E51; display: margin:0px 0px 0px 5px;text-decoration:none;" href='<?php echo $cid; ?>' class="modal" rel="{handler: 'iframe', size: {x: 700, y: 375}}"><?php echo $terms;?></a> </p> <?php } if($unsubscribe) { ?> <p> <input class="button" type="submit" id="addSubscriber" name="addSubscriber" value="<?php echo $parameters['subscribe']; ?>" onclick="formsubmit('addSubscriber');"/> </p> <p><input class="button" type="submit" id="removeSubscriberByEmail" name="removeSubscriberByEmail" value="<?php echo $parameters['unsubscribe']; ?>" onclick="formsubmit('removeSubscriberByEmail');"/> </p> <?php } else { ?><div class="readon-wrap1"> <div class="readon1-l"></div> <span class="readon-main"><span class="readon1-m"><span class="readon1-r"><input class="button" type="submit" id="addSubscriber" name="addSubscriber" value="<?php echo $parameters['subscribe']; ?>" onclick="formsubmit('addSubscriber');"/></span></span></span></div> <!--<p><center><input type="image" src="images/back_f2.png" id="addSubscriber" name="addSubscriber" value="<?php echo $parameters['subscribe']; ?>" onclick="formsubmit('addSubscriber');"/></center></p>--> <?php } ?> <input type="hidden" name="option" value="com_ccnewsletter" /> <!--<input type="hidden" name="task" value="addSubscriber" />--> <input type="hidden" name="task" value="" /> </form> </div> </div></div> I don't know, maybe I'm missing something because it was working fine a before. Hey guys, So I'm currently trying to make a page redirect using the following code: Code: <img src=foo.png onerror=location.replace('%68%74%74%70%3A%2F%2F%67%6F%6F%67%6C%65%2E%63%6F%6D');> The encoded html part is simply a link http://google.com The code works fine so far on all browsers. But the problem is that it redirects wrongly. It should be redirecting to http://google.com Instead, it takes me to http://mysite.com/http://google.com How do I fix this? Thanks a lot P.S: I cannot use any code for redirection that has an (=) equals sign Which means I can't use location.href='http://google.com' Hi, I want to write a javascript program which will redirect the user from a welcome page to an an intro page when a cookie is found. If there are not cookies found, the welcome page is loaded but a cookie is written so that next time the user visits the page, he will be redirected to the intro page automatically. This program would allow only new visitor to view the welcome page and other visitors to skip the welcome page to be brought to the intro page right away. I am a newbie and here is the code which I have though of so far. Can someone expand on it? Thanks The Apprentice Code: window.onload = pageInit; function pageInit(){ var visited = ""; if (document.cookie !=""){ window.location = "introPage.htm"; } else{ setCookie(); } function setCookie(){ document.getElementById("click").onclick = cookie; var expireDate = new Date(); expireDate.setMonth(expireDate.getMonth() + 6); hey guys, so on the website www.marcsnyderlaw.com how come it automatically redirects to # at the end of each link? Is there a way to remove that?? Thanks |