Jump to content
UBot Underground

linking ui drop down boxes


Recommended Posts

has anyone done any linking of ui drop down boxes

for example first box would be categories second box would be sub categories.

so if the user picked fruit in the first drop down the second drop would populate the sub options apples,oranges etc.

 

I could programme this in ubot but this would need to happen before the bot runs and update instantly.

anyone done this? java maybe?

Link to post
Share on other sites
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
function moveData(data) {
var parts = data.split('/');
var f = document.form1;
alert(parts[0]+":"+parts[1]);
f.cat.value = parts[0];
f.sub.value = parts[1];
}
</script>

<style type="text/css">
* {margin:0;padding:0;}
</style>

</head>
<body>
<form name="form1" action="http://www.domain.com/cgi-bin/submit.pl" method="post">

<select name="catsub" onchange="moveData(this.value);" size="10">
<optgroup label="Fruit">
<option value="Fruit/Apple">Apple
<option value="Fruit/Orange">Orange
<option value="Fruit/Pear"> Pear
<optgroup label="Animal">
<option value="Animal/Dog">Dog
<option value="Animal/Cat">Cat
</select>

<input type="text" name="cat">
<input type="text" name="sub">



</form>
</body>
</html>

with a bit of roaming and digging in my memory of  the old days of writing html scada reports I've come up with the attached it splits from the selector and puts it into two variables what I don't know is how to get these two variable values into ubot.

any ideas or suggestions for improvements.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...