0

(The site i am going to talk about can be accessed at http://www.akbrowser.tk/preset.html )

The portion of the site that I am going to talk about is below:

<html>
<head>
<title>Preset AKBrowser</title>
</head>
<body bgcolor="000000">
<center>
<table bgcolor="00FFFF" width="50%">
<tr><td>
<br>
<br>
<br>
AKBrowser 
<br>
<br>
<form id="akbrowser">
URL: <input type="text" name="aouwygbaiusvsjkraeiwc" value="http://www." />   
<br>
<INPUT TYPE="button" NAME="button" Value="Submit"  onClick="postakbrowser(document.akbrowser.aouwygbaiusvsjkraeiwc.value)">
</form>
<br><br>
<script type="text/javascript">
function postakbrowser(x) 
{
document.write("http://www.akbrowser.tk/?aouwygbaiusvsjkraeiwc=" + "x");
}
</script>
</td></tr>
</table>
</body>
</html>

(If you visited the webpage, the part above is everything above the horizontal line)

So, as you can see, I am trying to make a form, such that when the submit button is clicked, a javascript function (called postakbrowser() ) runs.

Let us say that "cheese" was inputted in the form

as you can see, I want the string "http://www.akbrowser.tk/?aouwygbaiusvsjkraeiwc=cheese" to be posted below the form

I don't understand why it doesn't work!

Can I have some help? thanks!

2 Answers 2

2

You don't need JavaScript for that. HTML forms do all that hard work for you by default.

Just put this as your form tag:

<form name="input" action="script_name" method="GET">

And then you can simply use the submit input tag to handle the event:

<input type="submit" Value="Submit" />
Sign up to request clarification or add additional context in comments.

1 Comment

I tried that, but it leads to a 404 error. I think it is interpreting my postakbrowser(document.akbrowser.aouwygbaiusvsjkraeiwc.value) as a link, which it isn't, so it goes to a 404 error. After omitting the quotation marks (so it looked like action=postakbrowser(document.akbrowser.aouwygbaiusvsjkraeiwc.value) ), it didn't do anything, just like before
1

why are you doing that

document.write("http://www.akbrowser.tk/?aouwygbaiusvsjkraeiwc=" + "x");

I think you only have to do this

document.write("http://www.akbrowser.tk/?aouwygbaiusvsjkraeiwc=" + x);

give a try

1 Comment

Yeah. thanks, I fixed it, but it still didn't do what I wanted it to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.