Reply to topic
Change cfinput attributes?
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
Can I change the <cfinput> attributes with JS?

Say I have a required field, and if I select a radio button I want to changes this field from required=yes to required=no.

Can I o that?

Because I have this JS to do that, and it doesn't seem to work.
Code:
   document.getElementById("buyerFirstName").required ='no';


When I click on submit it still gives me the required field msg.
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
No.

The reason why, is because when ColdFusion compiles the page, it puts the appropriate JavaScript for the validation in the page.If you were to "view source" in the browser, you would see your input fields have changed to plain <input>, and a lot of JavaScript at the top of the page.

If you want to do advanced validation, I recommend using QForms (extremely simply to use and implement.) or writing your own validation
Change cfinput attributes?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic