"Rob Wahmann" <rob@dotcomstudio.biz> wrote in message
news:H_w2c.31378$PY.4729@newssvr26.news.prodigy.co m...[color=blue]
> "Randy Webb" <hikksnotathome@aol.com> wrote in message
> news:8sydnZBqLKxI0dfdRVn-iQ@comcast.com...[color=green]
> > Rob Wahmann wrote:
> >
> > Top posting fixed - please read the FAQ with regards to top-posting,
> > quoting and snipping.
> >[color=darkred]
> > >><script type="text/javascript">
> > >> function launchIt(select) {
> > >> var option = select.options[select.selectedIndex];
> > >> if (option != ''){
> > >> window.open(option.value,option.getAttribute('name '));
> > >> }
> > >> }
> > >></script>
> > > Hmm... I see where you're going with this but it still allows me to[/color][/color]
> submit[color=green][color=darkred]
> > > empty values. Thanks for the assistance!
> > >[/color]
> >
> > "submit empty values" ?? You are not submitting a form, you are simply
> > opening a new window with a URL parameter. The parameter happens to be a
> > variable scenario that mimics a form post. To verify that, put an
> > onsubmit="alert('I am submitting')" on the form and see if you see it.
> > Using the above script, you won't. And as written, its not even
> > appending the variables, its simply opening a new window with the URL
> > set to the select value, and the name of the window being the same as
> > the "name" attribute of the option that was chosen at the time.
> >
> > Perhaps a little more explanation of what you are trying to do?
> > Submitting a search to google takes a little more than what you are[/color][/color]
doing.[color=blue][color=green]
> >
> > --
> > Randy
> > Chance Favors The Prepared Mind
> > comp.lang.javascript FAQ -
http://jibbering.com/faq/[/color]
>
> Sorry for any mistakes in posting to this thread (no professional news
> poster here but i do appreciate the help). The empty value I'm referring[/color]
to[color=blue]
> is shown below. I want the ability to categorize options and not allow
> windows to be launched where the value is "". If you select "Select[/color]
Service"[color=blue]
> below you'll see that a new window is launched to your default browser[/color]
home[color=blue]
> page. Instead, I would like for the form to do nothing. I'm toying around
> with this but I greatly appreciate anyone's advice.
>
> <option value="" name="select">Select Service</option> <!-- this has an
> empty value "" -->
> <option value="http://www.anydomain.com/"[/color]
name="anydomain">Anywhere</option>[color=blue]
> <option value="http://www.whocares.com/" name="whocares">Who[/color]
Cares</option>[color=blue]
>
> TIA - Rob[/color]
function launchIt(select) {
var option = select.options[select.selectedIndex];
if (option.getAttribute('name') != ''){
window.open(option.value,option.getAttribute('name '));
}
}
Call me crazy but I believe I may have fixed this myself... The value or the
name can empty and that's fine with me. The script above seems to work.
Thanks again!
Rob