Galexrt Galexrt - 2 months ago 60x
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.