Wednesday, 15 May 2013

javascript - Calling string from one function into another doesent seem to work., why? -



javascript - Calling string from one function into another doesent seem to work., why? -

so have code , not seem work. thing want phone call "together" function "go" in function "second". doing wrong?

the programme supposed take in input-text , add together ".com" or ".no"(depending on u checked) , redirect page. want phone call "together" in "second" function. there improve way it?

class="snippet-code-html lang-html prettyprint-override"><!doctype html> <html> <head> <title>a basic form</title> <link rel="stylesheet" type="text/css"> <style type="text/css"> </style> </head> <body> <fieldset> <legend>redirection: </legend> <div> <label>where want go?</label> <input type="text" id="input" name="input" size="7"> <input type="button" id="submit" name="submit" value="submit" onclick="go()"> </div> <div> <input type="radio" id="no" name="end" value=".no"> <label for="no">.no</label><br /> <input type="radio" id="com" name="end" value=".com"> <label for="com">.com</label> </div> </fieldset> <script type="text/javascript"> var end = ""; var input = document.getelementbyid("input").value; function go(end, input){ if (document.getelementbyid("no").checked){ end = document.getelementbyid("no").value; }else if (document.getelementbyid("com").checked){ end = document.getelementbyid("com").value; }else{ alert("please take category!"); } var = input + end; // window.location.replace("http://www." + together); } second(together); function second(together){ alert(together); } </script> </body> </html>

function go(end, input){ if (document.getelementbyid("no").checked){ end = document.getelementbyid("no").value; }else if (document.getelementbyid("com").checked){ end = document.getelementbyid("com").value; }else{ alert("please take category!"); } var = input + end; // window.location.replace("http://www." + together); } // remove second(together); } // add together

javascript

No comments:

Post a Comment