Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
I need help to make form with only 1 filed
Old 08-10-2009, 01:10 PM I need help to make form with only 1 filed
Novice Talker

Posts: 10
Trades: 0
In my website i have many articles... URL of each article is like below

http://www.mysite.com/article/1
http://www.mysite.com/article/2
http://www.mysite.com/article/3
http://www.mysite.com/article/4

Etc...

So each article got a number in the URL

>>>>> What I need now is <<<<<<

To make little form with only 1 filed in main page
Filed is to add the article number... Then by submitting the form the URL of article will open

For example:

If I enter number 4 and click submit
That will open URL http://www.mysite.com/article/4

Thank you
[FONT='Arial','sans-serif'][/FONT]
WMASTER is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-10-2009, 01:16 PM Re: I need help to make form with only 1 filed
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
HTML Code:
<form name="thisform" action="" method="post">
<input type="text" name="artref">
<input type="submit" value="go">
</form>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-10-2009, 01:22 PM Re: I need help to make form with only 1 filed
Novice Talker

Posts: 10
Trades: 0
thank you chrishirst

but where to add the link of URL in this form ..

which is

http://www.mysite.com/article/ .. and the number which i enter it in filed 4
so the page will open should be
http://www.mysite.com/article/4
WMASTER is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 01:43 PM Re: I need help to make form with only 1 filed
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Like all forms, the URL goes in the action attribute.

Not forgetting that you will also need to write the necessary server side code to make the whole thing actually work of course.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-10-2009, 02:19 PM Re: I need help to make form with only 1 filed
Novice Talker

Posts: 10
Trades: 0
I am beginner without enough experince to do that

can you please give me the full html form code as my example above
and what to add in server side ?

Your help will be highly appreciated
WMASTER is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 02:22 PM Re: I need help to make form with only 1 filed
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
and what to add in server side
Absolutely no idea!

We do not know what code your server runs.
We do not know what database your site uses and
We do not know the structure of the database tables that hold the "articles"
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-10-2009, 02:28 PM Re: I need help to make form with only 1 filed
Novice Talker

Posts: 10
Trades: 0
I was think it is not complicated

because only if I enter number 4
it will open http://www.mysite.com/article/4

if i enter number 3
it will open http://www.mysite.com/article/4

etc ...

so the link http://www.mysite.com/article/ will never be changed .. only numbers change depend on number entered in the filed
WMASTER is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 03:13 PM Re: I need help to make form with only 1 filed
Banned

Posts: 315
Name: Doug
Trades: 1
What you want to do can be done one of two ways,
but neither of them are novice level.
And no one here is going to code your site for you for free.

You get what you PAY for. Place an ad in MarketPlace.
marketingman100 is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 03:54 PM Re: I need help to make form with only 1 filed
Ninja's Avatar
Experienced Talker

Posts: 30
Trades: 0
What you are trying to do cannot be done with HTML alone. You need to learn a scripting language like PHP.
The server that hosts your website will support the use of particular scripting languages, find what these are first
Ninja is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 04:57 PM Re: I need help to make form with only 1 filed
Novice Talker

Posts: 10
Trades: 0
thank you all

i got the code from somewhere else:

Code:
<form action="#" onsubmit="location.href='http://www.mysite.com/article/'+this.indx.value; return false;">
   <input name="indx" type="text" size="3" />
   <input name="btn" type="submit" value="Go" />
</form>
WMASTER is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 09:55 PM Re: I need help to make form with only 1 filed
Ninja's Avatar
Experienced Talker

Posts: 30
Trades: 0
Yes that will work but be aware that the code will only function for people who have javascript turned on in their browser or are using a user agent that supports javascript.
Ninja is offline
Reply With Quote
View Public Profile
 
Old 08-12-2009, 01:41 PM Re: I need help to make form with only 1 filed
alexxxl's Avatar
Average Talker

Posts: 18
Name: Alex S. K.
Location: Bishkek, KG
Trades: 0
Source of the PHP file "action.php"
PHP Code:
<?
$num 
$_POST['num'];
$adr "http://www.mysite.com"//Full URL of root to article (without slash)
header("location: $adr/$num");
?>
HTML form
HTML Code:
<form action="action.php" method="post">
<input type="text" name="num" size="2" maxlength="5" value="" />
<input type="submit" value="GO" />
</form>
Number of the article sends to the action.php and
then user redirects to the article`s page.
alexxxl is offline
Reply With Quote
View Public Profile Visit alexxxl's homepage!
 
Old 08-14-2009, 08:47 AM Re: I need help to make form with only 1 filed
Junior Talker

Posts: 3
Trades: 0
Quote:
Originally Posted by WMASTER View Post
thank you all

i got the code from somewhere else:

Code:
<form action="#" onsubmit="location.href='http://www.mysite.com/article/'+this.indx.value; return false;">
   <input name="indx" type="text" size="3" />
   <input name="btn" type="submit" value="Go" />
</form>
This is only a HTML coding for form field u need PHP coding or my sql coding to open database connection of your form field
__________________

Please login or register to view this content. Registration is FREE
marsal is offline
Reply With Quote
View Public Profile Visit marsal's homepage!
 
Reply     « Reply to I need help to make form with only 1 filed
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 3.80166 seconds with 12 queries