Galexrt Galexrt - 7 months ago 99
Javascript Question

Send post data to iframe and reload the iframe

I tried something something like this using jquery, but i failed.

type: "POST",
url: "myphphere.php",
data: {
command: $('#command').var()

I also thought about refreshing the page using the onclick attribute of a button to submit the form.


why just use an target attribute in form?

<form action="..." target="an_iframe" type="post">
<input type="text" name="cmd" placeholder="type a command here..." />
<input type="submit" value="Run!" />
<iframe id="an_iframe"></iframe>

Hope it solved your problem.