Basic code Field auot populates based on value of another field
#1
Posted 18 September 2009 - 02:11 PM
A Field autopopulates with a list of options based on value of another field.
I don't know if you need any info from me.....I was just looking for this basic code or if you can direct me somehwere where I can read how to put this code together. Thanks
#3
Posted 18 September 2009 - 03:07 PM
#4
Posted 21 September 2009 - 10:39 AM
amyl, on Sep 18 2009, 03:07 PM, said:
groovicus, on Sep 18 2009, 02:58 PM, said:
Yes. I have a list box with options and if option "Example" is selected I would like a different field to auto-populate with the number "4."
I am using wform so I can either add HTML code in with the data or save Javascript in a seperate file and specify the file in custom.
I don't know which would be easiest. I have done minimal Javascript but I know enough that I can plug the info I need int othe basic code.
#5
Posted 21 September 2009 - 11:23 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<script type="text/javascript">
function change(){
var valSelected = document.getElementById("dropDown").value
document.getElementById("outText").innerHTML = "You have selected " + valSelected;
document.getElementById("outBox").value = "Selection = " + valSelected;
}
</script>
</head>
<body>
<select name="menu" id="dropDown" onchange="change()">
<option value="0" selected>(please select:)</option>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
<br />
<div id="outText"></div>
<br />
Output:<input type="text" id="outBox" value="This will change"/>
</body>
</html>
#6
Posted 21 September 2009 - 02:32 PM
Will I still use same code above? (since my list boxes are already created)
#8
Posted 21 September 2009 - 04:19 PM
#9
Posted 21 September 2009 - 04:40 PM
I suppose that once you have your form built, you could look at the code it generates (which I assume is going to be HTML anyway), and manually add the id attribute.
#10
Posted 22 September 2009 - 07:35 AM
groovicus, on Sep 21 2009, 04:40 PM, said:
I suppose that once you have your form built, you could look at the code it generates (which I assume is going to be HTML anyway), and manually add the id attribute.
We have to use this form.....it's for my job. The form does come with a JavaScript function File where I can add my code and save as a file...then add the file into this custom field and it reads the code in the background. However, I have used html in the contents within the field of this form instead of putting a code in a file so I was thinking that I could just do the same for Javascript within the text I am using. I wish I could just write my own it would be easier yes!
I will try to figure it out thanks so much for all your help
#11
Posted 07 October 2009 - 10:15 AM
Is there anything I can use for this?
Steve
#12
Posted 07 October 2009 - 11:26 AM

Help


Back to top










