Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

iFrame input help!


  • Please log in to reply

#1
MaverickSidewinder

MaverickSidewinder

    Member

  • Member
  • PipPipPip
  • 257 posts
Hey everyone, first post here. I have a problem :S

Is it possible to use to input fields and a submit button with this code:

Code:

<form name="input" action="LINK"
method="get">
Code:
<input type="text" name="codice">
Code2:
<input type="text" name="code2">
<input type="submit" value="Submit">
</form>

I want the user to insert CODE and the CODE2 values and then to click SUBMIT. This submit action will add the values into a link:

http://something.com/random.asp?code=CODE&code2=CODE2

Then I would like this generated link to be automatically added as the "src" of an iframe on the same page once the user presses submit....is this possible?

What sort of syntax do I need to use in the form/input/submit fields? How do I get it to work?

Here is the basic layout of the page:


Code: [code input field]  Code2: [code2 input field]  (SUBMIT BUTTON)

// the above values are then added into the link so that the the link becomes:
// http://something.com/random.asp?code=CODE&code2=CODE2
// the link is then added as the "src" for the iframe underneath

<iframe src="link above"></iframe>

If all of this is possible then it would be great!


p.s. is it possible to make an iframe refresh on itself every 30 seconds?


Sorry for all the questions and thanks!
  • 0

Advertisements


#2
lem.rar

lem.rar

    Member

  • Member
  • PipPip
  • 94 posts
Javascript would make this easier. Just make two variables, and have the user set the variables via the form and once you hit submit, have the iframe redirect to a page in which you have inserted the variables to. Such as onclick="iframename.location=http://example.com/foo+bar".

It's been a while since I've scripted JS, however the idea here is correct.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP