473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Please help - URL based on textbox

Need help - I'm new to javascript. I need to create a URL based on a
textbox.

Idea is user enters a number into a text box then clicks button which
retrieves a link based on the number previously entered in the
textbox. Something like:

http://www.xyz123.com/constanttext/<number from box>/constant/

Any ideas?

Thanx,
Craig

Feb 15 '07 #1
3 1969
fo******@gmail.com said the following on 2/14/2007 9:47 PM:
Need help - I'm new to javascript. I need to create a URL based on a
textbox.

Idea is user enters a number into a text box then clicks button which
retrieves a link based on the number previously entered in the
textbox. Something like:

http://www.xyz123.com/constanttext/<number from box>/constant/

Any ideas?
Lots of ideas. Some not fit to post in a family oriented group.

beginningOfURL = http://www.xyz123.com/constanttext/'
middleOfURL = document.forms['formID'].elements['textBoxNAME'].value
endOfURL = '/constant/'
completeURL = beginningOfURL + middleOfURL + endOfURL

document.location.href=completeURL
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 15 '07 #2
ASM
fo******@gmail.com a écrit :
Need help - I'm new to javascript. I need to create a URL based on a
textbox.

Idea is user enters a number into a text box then clicks button which
retrieves a link based on the number previously entered in the
textbox. Something like:

http://www.xyz123.com/constanttext/<number from box>/constant/

Any ideas?
How user could know which numbers are available ?

<select onchange="var k = this.options.selectedIndex;
if(k==0) {alert('choice in list');return}
location.href='http://www.xyz123.com/constanttext/'+
this.options[k].value+'/constant/';">
<option>Find next</option>
<option value="1">1</option>
<option value="214">2</option>
<option value="48">3</option>
</select>

With an input :

<input onchange="location.href='http://www.xyz123.com/constanttext/'+
this.value+'/constant/';">
<input name="false_button" type=button value="go">

or :

<form action="http://www.xyz123.com/constanttext/"
onsubmit="this.action += this.number.value + '/constant/';">
Enter a number here: <input name="number" type=text>
<input type=submit value="go">
</form>

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Feb 15 '07 #3
On Feb 15, 3:21 am, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
forbi...@gmail.com a écrit :
Need help - I'm new to javascript. I need to create a URL based on a
textbox.
Idea is user enters a number into a text box then clicks button which
retrieves a link based on the number previously entered in the
textbox. Something like:
http://www.xyz123.com/constanttext/<number from box>/constant/
Any ideas?

How user could know which numbers are available ?

<select onchange="var k = this.options.selectedIndex;
if(k==0) {alert('choice in list');return}
location.href='http://www.xyz123.com/constanttext/'+
this.options[k].value+'/constant/';">
<option>Find next</option>
<option value="1">1</option>
<option value="214">2</option>
<option value="48">3</option>
</select>

With an input :

<input onchange="location.href='http://www.xyz123.com/constanttext/'+
this.value+'/constant/';">
<input name="false_button" type=button value="go">

or :

<form action="http://www.xyz123.com/constanttext/"
onsubmit="this.action += this.number.value + '/constant/';">
Enter a number here: <input name="number" type=text>
<input type=submit value="go">
</form>

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé

Thank you both very much - your help got me past the problem Works
fine.

Thanx
Craig

Feb 16 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Carlos Ribeiro | last post by:
I'm doing some experiments with mini declarative languages (as explained by David Mertz in http://www-106.ibm.com/developerworks/library/l-cpdec.html) in Python, with the intention to use it as...
1
by: edb | last post by:
Hi, I have a previous validation If-then that works fine. If online form has input from the input tag I want to insert it into tables in SQL. Interestingly, I have built an RDBMS in SQL and...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
3
by: RockNRoll | last post by:
Greetings, Can I select an item in a listbox based on user textbox entry and a submit button? Can you provide any code examples for what needs to occur when the user clicks submit? Thank you,...
2
by: I am Sam | last post by:
Ok I set up a button column to delete an individual record. Nothing happens when I test it. Someone please help understand why. Below is the associated coding: DataGrid control: ...
8
by: Sandy | last post by:
I have two tables, tblPost - (Cols PostID, TopicID, UserID, Question, PostMsg and PostDT) and tblTopic - (Cols TopicID, Topic). I am trying to get tblPost.Question and tblPost.PostDT into...
6
by: Scott Kilbourn | last post by:
Hi, I'm writing a control that inherits from TextBox. I need to adjust the width of this control based on the number of characters in the control. I'm having a hard time with this. The...
0
by: Oenone | last post by:
I would like to set the caret position in a (single-line) textbox to a position based on the number of pixels from the left of the control. For example, I want the caret to be positioned 50...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.