Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Javascript novice in need of help

    Hi. I'm a little clueless about Javascript, so I need some help.

    What I want to do is create a page where a user can get a customized snippet of HTML that has user-chosen stuff through a color picker and drop-down menus, and then either display the result in a textarea, or better yet, send the code directly to another website's (not my own) form fields automatically (although I don't think it can be done, but it doesn't hurt to ask).

    The page the user sees can only use HTML & Javascript, unfortunately. I'm using Adobe AIR (Apollo) to make this project but I don't have the slightest clue how to use Flash or Flex or actionscript, so I'm using the HTML/Javascript method.

    Anybody know how I could accomplish this?

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    What I want to do is create a page where a user can get a customized snippet of HTML that has user-chosen stuff through a color picker and drop-down menus, and then either display the result in a textarea,
    That didn't make quite enough sense for me to figure out what you actually want to do. Maybe if you do a step-by-step description of what you'd like to have happen?

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah - sometimes my fingers go faster than my brain...

    What I want to do is create an app that will generate a template for use on Cafepress.com (although this could be used as a simple HTML template too). They should be able to customize it by typing in a title and subtitle, using a color picker (I got the Yahoo one but I haven't tried it yet so I don't know if I'll get it to work) to select the background, foreground and text/link colors, choose fonts, and so on, and then send the resulting code to a text area they can cut and paste out of.

    Ideally, it could also send the code straight to Cafepress.com's custom HTML page so the user wouldn't have to enter all the code. But this would require signing in, selecting the correct shop, going to the custom HTML page, filling the forms and submitting it (in a really ideal situation it could backup the existing data). But I don't expect that this would be possible with Javascript, although I really have little clue what you can really do with it. Which is why I'm asking here

  • #4
    Regular Coder kosstr12's Avatar
    Join Date
    Apr 2007
    Location
    Woodstock, Georgia
    Posts
    428
    Thanks
    7
    Thanked 5 Times in 5 Posts
    So...You need help building a script generator? If that's the case, You're going to need someone that a the next few hours/days to spend on helping you. User friendly code generator take a good bit of time to master and you might end up having to pay for the script.


    HTH,
    koss

  • #5
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I think I've figured out how to put arbitrary content into a block that you can copy out of. This Google Answers thread seems to make it look pretty simple. I imagine it won't be too hard to make multiple fields and use text fields for them.

    Since I really don't need to do the sending directly to the site part (which would seriously complicate things) all I really need to figure out is how to use that technique with the Yahoo Color Picker to insert the color code.

    Anyone got any ideas on how to do that? That's all I really need. The code's a bit intimidating at first glance... Thank you!

  • #6
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Is this contraption of yours going to be submitted and processed by a server side language such as PHP or ASP? I scanned the YUI documentation briefly and found the format of the data that will be passed from the color picker to the server, which you can pick up and use on the server side, if you are planning on a "submit form" aspect of the user interface.

    If you want to handle the whole deal via Javascript without submitting to the server.... let me hunt around the docs a bit more and see if I can figure out where the data can be grabbed.

    (EDIT)
    Yeah ok it's a simple matter to get the color value in Javascript and use it for whatever nefarious purpose you have in mind. Look at this link here and study the example script. You will notice there is a simple "get" function you can call to retrieve the current color value:
    Code:
    var currentHexColor = picker.get("hex");
    You have to first instantiate the picker object, as they do in the example.
    Last edited by Fumigator; 08-25-2007 at 04:40 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •