Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) Setting form values without a drop down

  • Setting form values without a drop down

    Posted by Tumblemonster on September 7, 2005 at 4:54 pm

    I am building a web site that allows a user to click on a button to change the fabrics shown in an image of a clothing item. This allows the user to see what their custom designed clothing looks like before they purchase it. I am show/hiding floating layers containing various fabrics to create the effect. What I need to do is set the values that would normally be in a popup menu. I want them set on the buttons click, so when the submit button is pressed it reads these values.

    Anyone have an idea?

    -tm

    Curtis Thompson replied 20 years, 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • Curtis Thompson

    September 7, 2005 at 5:05 pm

    hello…

    not really following you perfectly – do you want to set the values of a popup dynamically? so like clear the current values and create new options in it? or did you just want to provide values for form elements?

    sitruc

  • Tumblemonster

    September 7, 2005 at 6:39 pm

    I just want to provide values for form elements.

    -Jason

  • Curtis Thompson

    September 7, 2005 at 6:46 pm

    hello…

    then something like this should work (a very simple example):

    <SCRIPT LANGUAGE=”JavaScript”>
    <–
    
    function setValues (formEl, val) {
        formEl.value = val;
    }
    
    //–>
    </SCRIPT>
    

    with formEl being the form object (so like document.myForm.myValue). then trigger that somehow – with an onClick on a button or something like that – then you can also customize it to set select values or other text field values as needed.

    still not sure what type of field you want to set a value for, so for now i’ll assume hiddens…but if this is too general an example, then you might find more what you’re looking for here:

    https://irt.org/script/form.htm

    or feel free to ask me to clarify!

    sitruc

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy