0

my URL looks like "www.google.com/" everything what I need to do is to add a specific word, what I will get from a javascript form, at the end of the url and then show in iframe. So if I will enter "test" into a form, an iframe will show "www.google.com/test" any ideas? Thank you a lot..

<form method="get" action="http://slovnik.juls.savba.sk/">
<form action="" method="get" target="_top">
 <input type="text" name="w" id="w" size="20" maxlength="40" value="" />
 <input type="submit" value="Nájdi" /> Stratégia: 
<select name="s"><option value="exact" selected="selected">Presne</option>
<option value="prefix" >Prefix</option>
<option value="substring" >Časť slova</option>
<option value="suffix" >Sufix</option>
</select>
 <input type="hidden" name="c" value="F819" />

v: KSSJ4

<span title="Pravidlá slovenského pravopisu"><input type="checkbox" name="d"  value="psp" checked="checked"/>PSP</span>
  </p>
</form>
1
  • Welcome at SO. Please edit your question so that it contains your HTML (at least form and iframe) and if you have tried some javascript code then include it in your question as well. Commented Jul 12, 2013 at 7:07

1 Answer 1

1

Try like

 var url = document.URL;
 var new_url = url + '/' + new_word;

Now append this new_url to your iframe like(May be like)

document.getElementById('myIframe').src = new_url;

Makesure that your iframe id is like myIframe

Sign up to request clarification or add additional context in comments.

1 Comment

How do i call iframe then?

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.