Repeat data entered in a text box... and maybe change it?

This is a discussion on "Repeat data entered in a text box... and maybe change it?" within the JavaScript Forum section. This forum, and the thread "Repeat data entered in a text box... and maybe change it? are both part of the Program Your Website category.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 28th, 2007, 16:55
Junior Member
Join Date: Jun 2006
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Question Repeat data entered in a text box... and maybe change it?

Hi everyone,

I have 3 upload boxes on my website for images (small, medium and large), lets call them box 1, box 2 and box 3. When I press a button next to each, I can find the image that I'd like to upload, and then it puts the path into the text box for me, so that I can change it if I want.

To save A LOT of time (there are loads of images in the folders, so it takes ages to load the window), I would like the path that is in box 1, to be repeated in boxes 2 and 3.

Now here's the more difficult part, that I'm not sure can even be done! The folders that the images are in are named s, m and l. If I choose the image in box 1 (from the folder s), when the path is repeated in the other boxes, is there anyway to automatically change the s, to m and l.

If the second point can't be done then no worries, any help at all with the first would be greatly appreciated.

Many thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 29th, 2007, 12:17
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Repeat data entered in a text box... and maybe change it?

This isn't really a possibility due to javascript not having access to files on a user's machine, this would pose quite a security risk.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 29th, 2007, 19:08
Junior Member
Join Date: Jun 2006
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Repeat data entered in a text box... and maybe change it?

Thanks for your reply, but I think I must have made it unclear.

The text boxes don't need to have any access to files, all I want it to do is to repeat the text that is entered into box 1, into boxes 2 and 3.

I've seen scripts to do this before, but only when a checkbox is selected. I'd like to do it when the text is changed, and to repeat the value from 1 box, in to 2 others.

Many thanks,
Simon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 30th, 2007, 02:36
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Repeat data entered in a text box... and maybe change it?

Okay, I get what you're saying but you are talking about <input type="file">'s right?

You click on browse or find and it opens a window to select a file then once selected the path to the file goes into the text box. Javascript can't change this value because if you could do that with javascript, then the file at that path can then be sent to the server so a malicious coder could ask for c:\passwords.txt and that file would be sent to the website without the user knowing.

You can change the values of text boxes easily enough but not file inputs.

Code: Select all
<script type="text/javascript">

function changeTexts(value) {
var inputBoxes = document.getElementByTagName(''input');

for (i = 0; i< inputBoxes.length; i++){
if (inputBoxes[i].type == 'text') {
     inputBoxes[i].value = value;
}
}
}
</script>

<input type="text" value="" name="hi" onchange="changeTexts(this.value)"/>
<input type="text" value="" name= "hi1" />
<input type="text" value="" name="hi3" />
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 2nd, 2007, 10:24
Junior Member
Join Date: Jun 2006
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Repeat data entered in a text box... and maybe change it?

Okay I'll give that a go, thanks for your help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

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
Change descriptive Google Text Jack Franklin Search Engine Optimization (SEO) 17 Dec 24th, 2007 14:15
change colour of text, on hover. Jason3107 Web Page Design 28 Sep 27th, 2007 23:10
background-repeat: repeat y not working properly AdRock Web Page Design 12 Feb 25th, 2007 22:17
change text underline colour help Aaron1988 Web Page Design 6 Aug 30th, 2006 19:18
Returning results into a table with no repeat of data lobster1983 PHP Forum 7 Sep 24th, 2005 20:23


All times are GMT. The time now is 14:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization 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