Jump to content

Is this not vaild in IE7 ??


laPistola

Recommended Posts

<input name="login" type="button" class="buttons" id="login" value="login" />

document.getElementById('login').type = 'submit';

 

works perfect in FF but will not work in IE7 i even tryed changing to .value to see if it would change the button name to submit but that didn't work either?

 

Thanks

Link to comment
Share on other sites

I'm sure there's some reason why you want to change a button type to a submit button, but I can't think of any good ones. Can you explain the reason behind what you are trying to accomplish? There might be a better solution. Besides, doing what you describe above would probably block any usesrs w/o JS enabled.

Link to comment
Share on other sites

Hi

 

Thats the point, my site uses alittle javascript as most is done with PHP but the little JS it uses would mean there would be a couple of minor security risks if the user has JS disbled so to prevent this from happening i set all the submit buttons as type=button but if the user has JS enabled the JS changes the type to submit, removing the ablity of any non js users even using the site. The <noscript> explains for them to use the site enable js.

 

anyway i fixed this myself a couple of hours after posting, i used the .innerHTML to change the whole <input type="button" etc etc /> to <input type="submit" etc etc /> which works in ff and ie.

 

cheers anyway

Link to comment
Share on other sites

yes but these are very very minor, what i have done is stopped the ones thats not so up on hacking from disabling js and get past what i have used js to stop them, no site is 100% secure its just doing your best to try and prevent what you can, plus they cant view the source of the PHP or external js scripts, to my knowledge anyway.

 

i plan to re-write as much of the java in a PHP driven version in v2 of the site anyway.

Link to comment
Share on other sites

plus they cant view the source of the PHP or external js scripts, to my knowledge anyway.

 

It is very easy to view the source of external JS files. Just look in the code of the HTML page for any references to external JS files and then put that URL into your browser and . . . presto, you can download the JS file.

 

It's your site, but IMHO, I've never understood why some people go through great lengths to try and prevent the casual user from certain actions as a security feature (e.g. disabling right-click) when it is the advanced users that need to be protected against. Especially when those extra measures can really foul up the site depending upon which browsers are being used.

 

But, as long as you have what you want, all is well.

Link to comment
Share on other sites

im taking steps in every way i can/know of to stop the causal and the advance users. to be honest all me disabling non js users is really just stopping them signing up with invaild details like username and email and skipping the age verfication, but i do plan to change these scripts to PHP alturnatives in v2 of the site

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.