/    Sign up×
Community /Pin to ProfileBookmark

Select Box Nav trouble shooting

I can’t seem to see why this would not work. Anyone have a minute to check it out? Its all part of purchaseorder.php

I have an echo statment at the top to show the value of
$_GET[‘venid’] to see if it works.

echo “<form name=’jump1′>”;
echo “<select name=’vendor’ OnChange=’location.href=jump1.vendor.options[selectedIndex].value’>”;
$recordset = mssql_query (“select * from vendors order by name”, $handle);
while($arr = mssql_fetch_row($recordset))
{
$venid = $arr[0];
$vendor = $arr[1];
echo “<option value=’purchaseorder.php?venid=$venid’>$vendor”;
}
echo “</select></td>”;
echo “</form>”;

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@PineSolPirateJul 13.2006 — I think you are looking to jump automatically onchange, right?

You want "window.location" I believe. Might want to try the javascript forum.
[CODE]echo "<form name='jump1'>";
echo "<select name='vendor' OnChange='window.location=jump1.vendor.options[selectedIndex].value'>";
$recordset = mssql_query ("select * from vendors order by name", $handle);
while($arr = mssql_fetch_row($recordset))
{
$venid = $arr[0];
$vendor = $arr[1];
echo "<option value='purchaseorder.php?venid=$venid'>$vendor";
}
echo "</select></td>";
echo "</form>";[/CODE]
Copy linkTweet thisAlerts:
@PineSolPirateJul 13.2006 — Also, it'd be easier (I think) to just use getElementById
[CODE]echo "<form name='jump1'>";
echo "<select [B]id='vendor' [/B]name='vendor' OnChange='[B]window.location=document.getElementById("vendor").value'>"[/B];
$recordset = mssql_query ("select * from vendors order by name", $handle);
while($arr = mssql_fetch_row($recordset))
{
$venid = $arr[0];
$vendor = $arr[1];
echo "<option value='purchaseorder.php?venid=$venid'>$vendor[B]</option>[/B]";
}
echo "</select></td>";
echo "</form>";[/CODE]
Also, close up that option tag ?
Copy linkTweet thisAlerts:
@Doc_ThirstauthorJul 13.2006 — LOL, thanks guys, I'll see what I can do with your suggestions.
Copy linkTweet thisAlerts:
@shane_carrJul 14.2006 — Also, is it just a mistake or is [B]mssql[/B] supposed to be [B]mysql[/B]?


[COLOR=White].[/COLOR]
×

Success!

Help @Doc_Thirst spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...