paulm
08-02-2003, 08:03 PM
I want two create a navigation system based on a combination of two form fields in this format:
formfield 1 : enter domain (e.g. http://www.domainname.com)
formfield 2 : enter page (e.g. pagename.html)
so then when the form is submitted they can directed to a combination of the two fields to a full url (e.g. http://www.domainname.com/pagename.html)
I got this far using one field but getting the combination to work is proving difficult ( at least with my limited knowledge of javascript)> here my example for one field:
form html:
<form name="form1" action="javascript:get_fullurl()">
<input type="text" name="url">
<input type="text" name="page">
<input type="submit" value="Go">
</form>
script:
function get_fullurl(){
var url = document.form1.url.value;
var stats = document.form1.page.value;
location.replace(url);
}
as you can see I only have the script working for one field at the mo , if anyone help me get the combination working I'd be aprreciative
Thanks .........
formfield 1 : enter domain (e.g. http://www.domainname.com)
formfield 2 : enter page (e.g. pagename.html)
so then when the form is submitted they can directed to a combination of the two fields to a full url (e.g. http://www.domainname.com/pagename.html)
I got this far using one field but getting the combination to work is proving difficult ( at least with my limited knowledge of javascript)> here my example for one field:
form html:
<form name="form1" action="javascript:get_fullurl()">
<input type="text" name="url">
<input type="text" name="page">
<input type="submit" value="Go">
</form>
script:
function get_fullurl(){
var url = document.form1.url.value;
var stats = document.form1.page.value;
location.replace(url);
}
as you can see I only have the script working for one field at the mo , if anyone help me get the combination working I'd be aprreciative
Thanks .........