March 03, 2011, 12:29 AM
Srinivas429Problem of loading the dropdown dynamically based on value passed from previous page.
Hi,
I have two html pages. In first one, I have input textbox. Once user enters value and click on submit, this value should pass to second page. In the second page I have a dropdown which is loading using another procedure. Now how can I pass the textbox value to the procedure. I want the dropdown values to be loaded based on the selected textbox value.
Any help will be greately appreciated.
Thanks in advance,
Webfocus 7.6.9.
March 03, 2011, 04:49 AM
GamPIf there is a procedure executed in between the two html pages, then the procedure will automatically receive the user-entered text from the text input if the call is performed using a form.
Since you want the dropdown on the second page to conform to the entered selection, I think you indeed need a procedure in between, so it should not be a problem.
March 03, 2011, 05:58 AM
Ramkumar - WebfousInject the Value from the previous page to an XML fex in the next page, wont work.
Someway try out Cookies....
March 03, 2011, 06:51 AM
Ramkumar - Webfous This Might Help You. Please go through the above link for more stuff....
March 03, 2011, 10:50 AM
<FreSte>Hi,
Below you'll find 2 very basic HTML-pages.
<!-- page1.htm -->
<html>
<script>
function loadNextPage() {
var _value = document.getElementById("value2Submit").value.toUpperCase() ;
window.open("page2.htm?" + _value);
}
</script>
<body>
Value to submit (A,B,C,D,E) = <input type="text" id="value2Submit">
<br><br>
<input type=button value="Submit" onclick=loadNextPage()>
</body>
</html>
<!-- page2.htm -->
<html>
<script>
function getSubmittedValue() {
var _submittedValue = location.search.substring(1,99);
var _obj = document.getElementById("selbox1");
for (var i=0; i<_obj.length; i++) {
if (_obj[i].value == _submittedValue) {
_obj[i].selected = true;
return;
}
}
}
</script>
<body onload=getSubmittedValue();>
<select size=5 id="selbox1">
<option value="A">Text A</option>
<option value="B">Text B</option>
<option value="C">Text C</option>
<option value="D">Text D</option>
<option value="E">Text E</option>
</select>
</body>
</html>
March 04, 2011, 05:16 AM
Srinivas429Thanks all.
The above link helped me to resolve the issue.
Once again thanks for your valuable suggesions.
Regards,
Srinivas
March 07, 2011, 03:52 AM
Ramkumar - WebfousHi Srinivas,
Happy that your issue is resolved. Mark this as Solved.