Galexrt Galexrt - 1 year ago 234
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download