Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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