DRW Submit Button...


1

116

I have a results section using a dropdown populated with years (2010, 2009,
etc) with a submit button. How can I have the results load based on the
default dropdown value when the page opens with out then need to click
submit? I tried <script type="text/javascript">
function clicksubmit()
{
document.forms[0].submit();
}
</script>
and added the function to 'Onload', but the screen seems to continuously
cycle.

David
 
Ad

Advertisements

S

Stefan B Rusynko

Try the tip at
http://blogs.msdn.com/lisawoll/archive/2004/06/22/162911.aspx
But add a default of selectedindex 0 , the as say first select list item

<script>
for (i = 0; i < document.forms[0].CategoryID.options.length; i++)
{
if (document.forms[0].CategoryID.options.value == "<%=request.form("CategoryID")%>")
{
document.forms[0].CategoryID.selectedIndex = i; break;
} else {
document.forms[0].CategoryID.selectedIndex = 0;
}
}
</script>

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


I have a results section using a dropdown populated with years (2010, 2009,
etc) with a submit button. How can I have the results load based on the
default dropdown value when the page opens with out then need to click
submit? I tried <script type="text/javascript">
function clicksubmit()
{
document.forms[0].submit();
}
</script>
and added the function to 'Onload', but the screen seems to continuously
cycle.

David
 
S

Stefan B Rusynko

My original suggestion won't work in the for next loop and won't auto submit the form
You are Probably better off setting a Default value when you set up the DBRW filtered results per step 6 in
http://support.microsoft.com/kb/235554

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


Try the tip at
http://blogs.msdn.com/lisawoll/archive/2004/06/22/162911.aspx
But add a default of selectedindex 0 , the as say first select list item

<script>
for (i = 0; i < document.forms[0].CategoryID.options.length; i++)
{
if (document.forms[0].CategoryID.options.value == "<%=request.form("CategoryID")%>")
{
document.forms[0].CategoryID.selectedIndex = i; break;
} else {
document.forms[0].CategoryID.selectedIndex = 0;
}
}
</script>

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


I have a results section using a dropdown populated with years (2010, 2009,
etc) with a submit button. How can I have the results load based on the
default dropdown value when the page opens with out then need to click
submit? I tried <script type="text/javascript">
function clicksubmit()
{
document.forms[0].submit();
}
</script>
and added the function to 'Onload', but the screen seems to continuously
cycle.

David
 
1

116

Thanks for the info. Regarding the default value. It is a year...meaning
next year 2011 would be the default. Can this be scripted?

David
 
1

116

Hello Stefan. Thanks for the info. Regarding the default value, this is a
'Year'. Can this be scripted? 2010 would not work for next year.

David
 
Ad

Advertisements

S

Stefan B Rusynko

Have you set the Default value to 2011 when you set up the DBRW filtered results per step 6 in the link I posted?


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


Thanks for the info. Regarding the default value. It is a year...meaning
next year 2011 would be the default. Can this be scripted?

David
 
Ad

Advertisements


Similar threads

1
Replies
2
Views
836
116
1
1
Replies
2
Views
951
Jon Spivey
J
1
Replies
2
Views
291
116
1
C
Replies
2
Views
202
Chuck
C
B
Replies
0
Views
316
blaine
B
F
Replies
1
Views
188
K.Ramana Reddy(GGK Tech)
K
T
Replies
3
Views
249
Tim
T
M
Replies
3
Views
121
Jim Buyens
J
Top