JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 14th, 2001, 08:05 AM
capendoc capendoc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: UK
Posts: 2 capendoc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy very easy JavaScript... but not for me!

I am trying very hard to do some javascript, but not very successfully. What I want to do is use a drop-down box on a form to provide the input to a text field in another form on the same page - but it's too hard!

Can anyone help???

Thanks very much.

Reply With Quote
  #2  
Old May 14th, 2001, 08:17 AM
Shmengy Shmengy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 7 Shmengy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The easiest way would be to use an onChange which executes a function once a selection is made in one list.

Reply With Quote
  #3  
Old May 14th, 2001, 08:30 AM
capendoc capendoc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: UK
Posts: 2 capendoc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks shmengy, but I had sort of worked that bit out, okay this is what I have so far - why doesn't it work?

in the head:

<script language="JavaScript">

<!-- Begin
function passText(str) {
mainform.project.value = str;
}
// End -->
</script>

then in the body....


<form name=selectform>
Select an Option:<br>
<select name="site" size=1>
<option value="">Go to....
<option value="test1">test1
<option value="test2">test2
<option value="test3">test3
<option value="test4">test4
<option value="test5">test5
<option value="test6">test6
</select>
<input type=button value="Ok!" onClick="passText(this.form.site.options[this.form.site.selectedIndex].value);">
</form>



<CFFORM ACTION="edit.cfm" ENCTYPE="application/x-www-form-urlencoded" METHOD=POST name="mainform">
<CFOUTPUT QUERY="GetEditInfo">
<table border="0" width="601" cellspacing="0">
<tr>
<td width="121">Our Ref: </td>
<td width="472"><input type="text" name="ourref" size="33" value="#ourref#"></td>
</tr>
<TR>
<TD>Project:</TD>
<TD>


<input type="text" name="project" size="33" value="">


where select form is the drop-down list to input into the field called "project" in mainform.

HELP!!??!!

Reply With Quote
  #4  
Old May 14th, 2001, 08:38 AM
Shmengy Shmengy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 7 Shmengy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I would put a onChange in the actual SELECT statement. Here is a page that I have done,

My old web page

and if you view the source it may help you. I hope!

Reply With Quote
  #5  
Old May 17th, 2001, 09:38 PM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
capendoc -

cfml not my area, but, anyway, you need to change your reference to

document.mainform.project.value = str;

as all named forms are document properties.

best,adios

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > very easy JavaScript... but not for me!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap