Use form to display non-preset images...?

This is a discussion on "Use form to display non-preset images...?" within the JavaScript Forum section. This forum, and the thread "Use form to display non-preset images...? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 31st, 2006, 14:35
New Member
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Use form to display non-preset images...?

Hey, how's it doin? This is my first time here and I hope it will be the best place

I am pretty sure this can be done with simple Javascript but I just can't find the appropriate script.

I have a form that askes for a filename.
-------------
<input type="text" name="filename"> .PNG
<input type="submit" value="Update"></form>
-------------
When I press 'Update' I want the page to dynamically (correct term?) load 6 images that begin with the word that was submitted in the form, followed by preset characters. Example:
Type your name:
"Mike"
then the page loads 'Mike_1.png', 'Mike_2.png' ... 'Mike_6.png'.

- Mike
Reply With Quote

  #2 (permalink)  
Old Feb 1st, 2006, 19:04
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Use form to display non-preset images...?

I'm a complete noob at javascript. Here's my thought for what it's worth. At least it's simple and it works, just an input and a "for" loop. I used a "prompt" for the name, I imagine you can modify that easily to substitute the return from your form:

Code: Select all
var name=prompt("Write in the name", "");

for (i = 1; i <= 5; i++)
{
document.write ("<img src=\""+name+i+".jpg\"><br><br>");
}
Be careful you don't leave any spaces in the return - this drove me nuts because I can't get full graphic properties on my editor and it was writing "mason1 .jpg".
Reply With Quote
  #3 (permalink)  
Old Feb 2nd, 2006, 00:03
New Member
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Use form to display non-preset images...?

I'm a n00b too
I think it's that 'document.write' I was looking for. I need to know the javascript equivalent to <img src=""> so I can include values and code in the address but I don't know what those commands are called to get a complete list. I'm trying to make a sort of category viewer where you input the word at the start of the image name and it only displays those images.

car_mike.png, horse_mike.png, bike_mike.png
INPUT = car
would only display the first one.

- Mike
Reply With Quote
Reply

Tags
use, form, display, nonpreset, images

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to display images/ Keeping file size down Oak Graphics and 3D 17 May 27th, 2008 17:03
Display different images? sing2trees Classic ASP 6 Jan 16th, 2008 05:15
Display results of a submit form (getting url) in same window?? jahphill JavaScript Forum 12 Nov 28th, 2007 23:18
The Best way to display Images and text thewebkid Website Planning 7 Nov 19th, 2007 13:56
Form Display Issue RichieRichR6 JavaScript Forum 4 Apr 18th, 2007 17:32


All times are GMT. The time now is 19:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43