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.

Coding Forum


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



Reply
Adding to the value of a text field.
Old 09-27-2004, 01:36 PM Adding to the value of a text field.
UnseenXS1's Avatar
Junior Talker

Posts: 2
Location: New Zealand.
Trades: 0
Right, not sure wether I should've posted this here, or in PHP forum.. I suppose there's probably someway to reach my solution using either or PHP/Javascript - I don't mind what the solution is, as long as it helps

What I'm wanting is to create a text field named 'level', the users enter a number from 1-99 in this field. When the form is submitted, I'd like the world "level" to be place in fron of the user-entered number.

So then, if a user were to enter the number "44". Instead of the value of 'level' being 44, it'd be 'level44'. Any help or suggestions much appreciated many thanx in advanced - UnseenXS
UnseenXS1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-27-2004, 02:45 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
You'd probably want to use PHP because Javascript can be turned off in viewers browser and if your script that is handling the form data doesn't test for correct data, then you might get some problems.

PHP Code:
$level 'level' $_POST['level']; 
Or Javascript, incase you still want it, would be something like this (I'm not at home right now so I can't really test it. Might want to put it in its own function or on a form onsubmit instead of a submit button onclick. But the PHP method will be more reliable either way.)
Code:
<form action="myscript.php" name="myform">
<input type="text" name="level" />
<input type="submit" onclick="var lvl = document.myform.level; lvl.value = "level" + lvl.value;" />
</form>
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 09-27-2004, 04:15 PM
UnseenXS1's Avatar
Junior Talker

Posts: 2
Location: New Zealand.
Trades: 0
Thanks

Last edited by UnseenXS1; 04-20-2006 at 02:26 AM..
UnseenXS1 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Adding to the value of a text field.
 

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 1.05641 seconds with 12 queries