PDA

View Full Version : Jump Menu!! How to add an extra field using Javascript.


tux
03-17-2007, 08:27 PM
Hi,

I have a jump menu that is being used to direct the user to a chosen photographer page. The jump menu sends a photographerID with the URL. I am using a function submiter () script but now need to send an imageID with the URL too.

Is there a way to add an extra field to the jump menu form and use it with script.

Here is the old script. Sending just the photographerID....

<script language="javascript" type="text/javascript">

function submiter(){

id = document.getElementById('menu').value;

if(id != '0'){
document.location.href='gallery_detail.asp?photogr apherid='+id;
}

}
</script>


.....and the form

<form id="form1" name="form1" method="post" action="">

<div align="right">
<select name="menu" class="photographerlist" onchange="submiter()">
<option value="">choose a photographer</option>
<%
While (NOT rs_photographerlist.EOF)
%>
<option value="<%=(rs_photographerlist.Fields.Item("photographerID").Value)%>"><%=(rs_photographerlist.Fields.Item("firstname").Value)%>&nbsp;<%=(rs_photographerlist.Fields.Item("lastname").Value)%></option>
<%
rs_photographerlist.MoveNext()
Wend
If (rs_photographerlist.CursorType > 0) Then
rs_photographerlist.MoveFirst
Else
rs_photographerlist.Requery
End If
%>
</select>

</div>
</form>

Here is the new script sending both photographerID and ImageID...

<script language="javascript" type="text/javascript">

function submiter(){

id = document.getElementById('menu').value;
phid = document.getElementById('photo').value;


if(id != '0'){
document.location.href='gallery_detail.asp?photogr apherid='+id+'&photo='+phid;
}

}
</script>

How can I amend the form to include the extra field required.

Thanks

Paul

westmatrix99
03-18-2007, 08:36 PM
12345678901