The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How embed web page input into web page call?, web page input automically brings up web page from input data
netmation
post Aug 7 2012, 01:08 AM
Post #1





Group: Members
Posts: 3
Joined: 7-August 12
Member No.: 17,569



Have the following code to accept input data in a web page single field....

<form id="search-form" method="get" action="" class="form-search">
<fieldset>
<input name="search" type="text" class="txt" id="search" value="Search Page#..." onfocus="if(this.value == 'Search Page#...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search Page#...';}"/>
<input type="submit" value="Submit" class="btn-search"/>
</fieldset>
</form>

I want to be able to take the user input (i.e. PAGENUM) and embed that into a web page URL to automatically popup into another browser instance, when the user hits SUBMIT in the above HTML code.

http://company.com/website/PAGENUM/index.html

Any assistance would be much appreciated.

Thanks, Al
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 7 2012, 09:15 AM
Post #2


.
********

Group: WDG Moderators
Posts: 4,776
Joined: 10-August 06
Member No.: 7



QUOTE(netmation @ Aug 7 2012, 08:08 AM) *

I want to be able to take the user input (i.e. PAGENUM) and embed that into a web page URL

That happens automatically when you submit a form with method GET. The user input is atached to the URL as its querystring.

QUOTE
to automatically popup into another browser instance, when the user hits SUBMIT in the above HTML code.

Not sure what you mean with "popup" and "browser instance". unsure.gif If you just mean you want the submitted form data to printed on the form result page then it can easily be done with the server-side script that handles the form submission.


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
netmation
post Aug 7 2012, 11:57 AM
Post #3





Group: Members
Posts: 3
Joined: 7-August 12
Member No.: 17,569



I probably wasn't clear in my initial post. I want to have a data entry box on a web page with a submit button. When the user enters text and hits submit a web page then opens up, using the entered text in the url string, in a new browser window.

For example if the user enters, "12345", the following web page opens up in a browser window, notice the "12345" in the url....

http://company.com/index.html?ln=12345&ff=1

Thanks for the help.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 7 2012, 01:15 PM
Post #4


.
********

Group: WDG Moderators
Posts: 4,776
Joined: 10-August 06
Member No.: 7



The easiest way is to give the form a target attribute:

CODE
<form action="" target="_blank">
<input type="text" name="ln" value="">
<input type="submit" value="Send">
</form>

If you want more control of the new window (size etc) javascript is needed.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
netmation
post Aug 9 2012, 12:37 PM
Post #5





Group: Members
Posts: 3
Joined: 7-August 12
Member No.: 17,569



Thanks Christian for the link and sample code. I will give it a try and let you know how I make out. Very much appreciated.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd May 2013 - 08:30 PM