September 25th, 2013, 02:34 PM
<script> document.write button doesn't show, but <noscript> button does?
I'm running into two issues with this code:
Note: The button "values" are just for testing purposes right now.
<input type="hidden" name="var1" value="val1">
document.write('<input type='button' value='Send Message Script' onClick='window.open('https://somesite.net','Windows','width=650,height=350,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');return false'>');
<noscript><input type="submit" value="Send Message NO Script"></noscript>
2. When I click the "Send Message NO Script" button (when js is turned off), the form does submit to the url indicated, however, the inputs on the form show up in the URI portion, hidden field as well as the textarea.
Why would that occur?
September 25th, 2013, 03:22 PM
Before I answer: Please leave this thread open and don't close it in the middle of the discussion like always. No idea why you do this and why you ignored my requests, but please don't do it this time, OK?
document.write('<input type='button' value='Send Message Script' onClick='window.open('https://somesite.net','Windows','width=650,height=350,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,loc ation=no,directories=no,status=no');return false'>');
I strongly suggest that you use a good editor like Notepad++ or an IDE like Netbeans. It will help you avoid syntax errors.
The next problem is that unaskedly opening windows is considered bad practice. This may have been OK in the 90s, but nowadays, many browser won't even allow it due to heavy absuse. The user decides how they want to view your page (in a new window, in a new tab or in the same tab). It's none of your business.
So I suggest you think this through again and come up with a smarter and more user-friendly approach. If you tell us what you wanna do, we can help you with that.
September 25th, 2013, 06:06 PM
Thanks for the reply, as always.
That's what I get for trying to do too many things simultaneously. Can't believe I forgot the method type in the form tag. Good thing I'm doing this in a dev environment eh?
And yes, now that I've read your post and thought about it, only one button is necessary in this case, so I've made the changes.
this is an interesting comment.
I suppose, it's indicative of a new, younger generation's attitude.
As for closing the thread, I generally do that 1) After I've acknowledged that I've found the answer/accepted the suggestion posted in the thread and 2) Since my OP has been answered, I close the thread so as to not leave it open indefinitely which a) may indicate to some an unresolved thread and b) folks don't ask me/tell me "why don't you close the thread when your done?"
But I digress. Again, thanks for the input.