SitePoint Sponsor |
|
User Tag List
Results 1 to 17 of 17
-
Aug 10, 2002, 04:40 #1
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
onclick event. Do I need quotes here...
Hey, this is the code (kinda) from one of my forms:
Code:<form name="submit1"> ... <input type="text" name="text"> <input type="button" name="verify" value="Verify" onClick="window.open('test.' + document.submit1.text.value ,'location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no' )" style="font-size: 8pt; font-family: Verdana; height: 21; width: 53"> ... </form>
Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 10, 2002, 10:37 #2
- Join Date
- Jan 2001
- Location
- Toronto
- Posts
- 106
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If I am guessing right, you are trying to open the value of the text box, in that case
Code:onClick="window.open('test', document.submit1.text.value ,'location=no,menubar...
-
Aug 10, 2002, 12:05 #3
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
actually, I'll be opening a php page with the value of the selected textbox item as a variable.
I was just playing tith the script so that i would open an html page named test.htm (htm would be the value)
Code:<input type="button" name="verify" value="Verify" onClick="window.open('verifycat.php?cat=' + document.submit1.comp_category.value)" style="font-size: 8pt; font-family: Verdana; height: 21; width: 53">
Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 10, 2002, 12:06 #4
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I just need to know how to fit the other options into it (scrollbars, resizable...)
Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 10, 2002, 20:21 #5
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
anyone?
Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 10, 2002, 20:33 #6
- Join Date
- Jan 2001
- Location
- Toronto
- Posts
- 106
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This should work:
onclick="window.open('','verifycat.php?cat=' + document.submit1.comp_category.value+'','scrollbars=no,etc.')"
-
Aug 10, 2002, 20:35 #7
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by jonsteele
This should work:
onclick="window.open('','verifycat.php?cat=' + document.submit1.comp_category.value+'','scrollbars=no,etc.')"Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 10, 2002, 20:48 #8
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Just tried it, no luck
Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 10, 2002, 23:18 #9
- Join Date
- Oct 2001
- Location
- Tucson, Arizona
- Posts
- 1,858
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You'll need to concatenate the two strings into a new variable before using them in the function.
-
Aug 10, 2002, 23:32 #10
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
OK, thanks matt
I'll go get a dictionary so I know what that means
Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 10, 2002, 23:54 #11
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
OK, I got it working. I'd just like to send a big shout-out and thanks to Wavelan for sending me the code
Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 11, 2002, 09:06 #12
- Join Date
- Jan 2001
- Location
- Toronto
- Posts
- 106
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
care to share
-
Aug 11, 2002, 16:05 #13
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Code:<script type="text/javascript"> <!-- function openwin(){ var cat = "mypage.php?cat="; var cat2 = document.formname.formfield.value; var cat3 = cat + cat2; window.open('cat3','category','scrollbar=0,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); document.close(); } //--> </script> <input type="button" name="verify" value="Verify" onclick="openwin()">
Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 11, 2002, 16:33 #14
- Join Date
- Aug 2001
- Location
- London
- Posts
- 2,475
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by naramation
Code:<script type="text/javascript"> <!-- function openwin(){ var cat = "mypage.php?cat="; var cat2 = document.formname.formfield.value; var cat3 = cat + cat2; window.open('cat3','category','scrollbar=0,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); document.close(); } //--> </script> <input type="button" name="verify" value="Verify" onclick="openwin()">
-
Aug 11, 2002, 16:49 #15
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I think so, but I don't know much js, thats why i posted here
It does work with quotes though. I'll try without.Mike
It's not who I am underneath, but what I do that defines me.
-
Aug 11, 2002, 16:54 #16
- Join Date
- Aug 2001
- Location
- London
- Posts
- 2,475
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
if you have it in quotes, the url will be cat3, but without them it will show the url any way i'd do it a bit differently anyway.
var cat = "mypage.php?cat=";
var cat2 = document.formname.formfield.value;
var cat3 = cat + cat2;
PHP Code:<script type="text/javascript">
<!--
function openwin()
{
window.open('mypage.php?cat=' + document.formname.formfield.value,'category','scrollbar=0,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
document.close();
}
//-->
</script>
-
Aug 11, 2002, 17:36 #17
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I tried that in the onclick right in the button, but it didn't work
window.open('mypage.php?cat=' + document.formname.formfield.value,'category','scrollbar=0,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
Is there a problem with wavelan's code, other than the quotes?Mike
It's not who I am underneath, but what I do that defines me.
Bookmarks