cformsII Support Forum
Current User: Guest *Frequently Asked Questions*
Search 
Search Forums:


 




javascript autosum and cforms (custom html within fieldset)

Add a New Topic Reply to Post
Post

zuja - Guest

5:21 pm - April 8, 2008

1

Please replace the ??? with your data!

  • Your URL: http://???
  • The browser used: ???
  • cforms version: ???
  • Your Wordpress version: ???

Please replace the ??? with your data!


[desc]:Hi there,

first, would like to say that I'm quite new with cforms but it is a
great tool and I'm really satisfied with the results i have until now.
But, I have a small problem you might have a solution. I created an
order form (http://wired.webmajstor.org/?page_id=15), and now I would
like to add a box with autosum results (small javascript code). Asyou
can see, I manualy addes my html code of the box, but that is not good
solutio. So, my question is, Is there any chance that I could add
custom html within fieldset, so I can create complete and functional
form. Thanks in advance.

Zuja
_

Oliver - Admin

6:17 pm - April 8, 2008

posts 3909

2

Not sure what you're trying to do, the above URL doesn't work.

add a box with autosum results

not sure what this is. can you give an example?

zuja - Guest

6:20 pm - April 8, 2008

3

zuja - Guest

7:04 pm - April 8, 2008

4

or, check this url again, it's working.

http://wired.webmajstor.org/?page_id=15

Oliver - Admin

8:05 pm - April 8, 2008

posts 3909

5

If you know the information about

  • Price: $ 119
  • You save: -
  • Deadline:

before you get to the order page, you can simply "feed" this data to regular cforms input fields via the link/button that points to the order form . These special input fields can further be set to "read-only".

example url:

http://wired.webmajstor.org/?page_id=15&cf_field_3=123

Try it any you'll see what I mean.

zuja - Guest

8:49 pm - April 8, 2008

6

Oliver, thank for reply.

I'm sorry, I'm quite new with cform, so could you explain me a bit more.

What I need is when I fill field PAGES with some number, eg. 2, that other field show price of two pages, then second field to show percent of saving and third field to show time needed for job to be completed.

I hope I explain this good.

Thanks and regards.

Oliver - Admin

9:04 pm - April 8, 2008

posts 3909

7

Ok, so if you need to adjust the value of a field based on changes made to another field, I recommend you get acquainted with jQuery. It's an easy to use JS framework that allows you to attach a small function to a given input field that gets triggered whenever the content of the field gets changed and you could then set programmatically the SUM input field.

  1. get jQuery and include it in your theme header
  2. create a JS function and attach it to the change event for a given input field
    1. or several input fields
  3. within that function, keep the SUM field of the form up to date

zuja - Guest

9:24 pm - April 8, 2008

8

OK Oliver, thanks for reply, I'll try that. I have another question connected with sam topic. Is it posible somehow to implement custom html within fieldset? AS you can see, (http://wired.webmajstor.org/?page_id=15 ) the box with the price, save, etc is added within page in wordpress , but not cform, and that is not good solution. I need to place some html code within fieldset, but i could find the way. Any solution?


Thanks in advance and regards.

Oliver - Admin

10:21 pm - April 8, 2008

posts 3909

9

It depends on what kind of code you're looking to add. Here are some options to change the look and feel of your forms:

  • of course you can change styles, frames & background images via CSS
  • you can insert actual HTML code for "text only fields" and even for the label part for all of the input fields
  • you could modify cforms.php and hard code additional HTML if the above doesn't suffice
  • finally you could use the same jQuery library to insert *any* html anywhere between the <form> tags

zuja - Guest

10:51 pm - April 8, 2008

10

Thanks Oliver,

you are very kind. I'll try what you suggested, and let you know if I sucseed.

Regards.

Reply to Post


Reply to Topic: javascript autosum and cforms (custom html within fieldset)
PLEASE READ THE FAQs FIRST! THANK YOU.

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Topic Reply:

Save New PostSmileysOptions

Guest URL (required)

Math Required!
What is the sum of:
6 + 6
   

 
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell

Search