JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



if/else to a working var/fuction


M

keyboard_arrow_up
0
keyboard_arrow_down


First Post Mark as Spam mariolemy
Posts: 1 - Registered: 2013-05-30 04:16:00

hi,

my code currently use a form to input the last part of a simple URL-link.
URL/_ _ _ _ _ the Var is fetch from the form input (work fine)

but if the form is empty...welll the link return an error and i wish to add a if/else statement just so that if the form is left empty i can have a dummy VAR inserted anyways and avoid the error404 that i currently get.

<script> function loopLookup (form) { var initials = form.initials.value; window.open("URL/<?php the_title(); ?>/" + initials, "", 'width=775,height=550,scrollbars=yes'); } </script> <form name="" action="" method=""> <input class="inputz" size="35" placeholder="<?php the_title(); ?>" type="text" disabled> + <input class="inputz" size="35" placeholder="Last Name" type="text" name="initials" value="" onkeydown="if(event.keyCode==13) loopLookup(this.form)"> = <input class="btn" type="button" name="button" value="View Full Names USA Records" onclick="loopLookup(this.form)"> </form>

I am really bad at codin
Thanks






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising