469,275 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Calling Different Submit Button Classes with Javascript

2
Is it possible to create a script that calls a different submit button class for a specific submit button in a form, whereas the rest of the buttons are another class?

These are the two button classes:

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2.  
  3. }
  4.  
  5. .FormSubmit{ 
  6. background-color: #8BD1FF; 
  7. border: 0; 
  8. margin-top:10px; 
  9. padding:3px; 
  10. font-family: arial, Helvetica, sans-serif; 
  11. font-size: 11px; 
  12. font-weight:bold; 
  13. color:#FFFFFF; 
  14. cursor:pointer; 
  15.  
  16. .completebutton{ 
  17. background-color: "red"; 
  18. border: 0; 
  19. margin-top:10px; 
  20. padding:3px; 
  21. font-family: arial, Helvetica, sans-serif; 
  22. font-size: 11px; 
  23. font-weight:bold; 
  24. color:#FFFFFF; 
  25. cursor:pointer; 
  26. }
  27.  
  28. </style>
I want to use this code for the last button in the form but it's hard coded so I don't have acess to it.

[HTML]<INPUT TYPE="Submit" NAME="submitForm" VALUE="complete registration" CLASS="completebutton">[/HTML]

Is there a way to get use this class when I want to, replacing the .FormSubmit that is used throughout the rest of the form?
Jan 24 '08 #1
4 1355
CroCrew
564 Expert 512MB
Why canít you just use buttons instead of submits?

Example:

Expand|Select|Wrap|Line Numbers
  1. <input type="button" value="Click Me" class="FormSubmit" onclick="document.Form1.submit();">
  2. <input type="button" value="Click Me" class="completebutton" onclick="document.Form2.submit();">
  3.  
Jan 24 '08 #2
adria
2
Why canít you just use buttons instead of submits?

Example:

Expand|Select|Wrap|Line Numbers
  1. <input type="button" value="Click Me" class="FormSubmit" onclick="document.Form2.submit();">
  2. <input type="button" value="Click Me" class="completebutton" onclick="document.Form2.submit();">
  3.  

I'm not sure if this will work because the submits are already hard coded in the application I am using.
Jan 24 '08 #3
CroCrew
564 Expert 512MB
I'm not sure if this will work because the submits are already hard coded in the application I am using.

Opps relook at my post. I made a change to the code.
Jan 24 '08 #4
Logician
210 100+
[HTML]<INPUT TYPE="Submit" NAME="submitForm" VALUE="complete registration" CLASS="completebutton">[/HTML]

Is there a way to get use this class when I want to, replacing the .FormSubmit that is used throughout the rest of the form?
Somewhere after the form is rendered:
Expand|Select|Wrap|Line Numbers
  1. document.forms.myForm.submitForm.className="completebutton";
Jan 25 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Julia Briggs | last post: by
6 posts views Thread by Adrian | last post: by
2 posts views Thread by Les Peabody | last post: by
5 posts views Thread by Jerry Camel | last post: by
5 posts views Thread by mike | last post: by
3 posts views Thread by Tanmaya Kulkarni | last post: by
5 posts views Thread by IchBin | last post: by
4 posts views Thread by raghuvendra | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.