SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast Kinaski's Avatar
    Join Date
    Dec 2007
    Location
    Macedonia
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get input fields values and assign them to a hidden field - mootools

    Hi all,

    I got an unusual request form a client. I got a form and I have to get values from certain input fields and assign them as a value to a hidden field and then submit it through php. I'm using mootools (1.11). I was tinkering around that for a day and wasn't able to solve it. Here is the html:
    HTML Code:
    <div>
              <label for="primary_domain0">Primary Domain Name <span class="req">*</span></label>
              <input type="text" title="Please enter your primary domain name." size="20" name="primary_domain0" maxlength="80" class="textfield spec" id="primary_domain0" />
            </div>
            <div>
              <label for="alias_domain0">Alias Domain Name <span class="req">*</span></label>
              <input type="text" title="Please enter your alias domain name." size="20" name="alias_domain0" maxlength="80" class="textfield spec" id="alias_domain0" />
            </div>
            <div>
              <label for="inbound_smtp_addr0">Inbound SMTP Host address <span class="req">*</span></label>
              <input type="text" title="Please enter your Inbound SMTP Host address." size="20" name="inbound_smtp0" maxlength="40" class="textfield spec" id="inbound_smtp0" />
            </div>
     <input type="hidden" name="get_all" id="get_all" value="" />
          
          <div class="sbmt">
            <input type="submit" name="submit" id="submit" class="button" value="Send til Mailscreen" />
          </div>
    Code:
    Code JavaScript:
    $('submit').addEvent('click', function(e){
    var all = $$('.spec').getProperties('name' , 'value');
    $('get_all').setProperty('value', all);
    });
    But all I receive in the hidden field value is:
    Code:
    [object Object],[object Object],[object Object]
    Please can anyone help me how should I code this the proper way?

    Thank you in advance.

  2. #2
    SitePoint Enthusiast Kinaski's Avatar
    Join Date
    Dec 2007
    Location
    Macedonia
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh, nevermind I solved it myself. Please mods close the thread. Thanks for anyone looking at it.


Bookmarks

Posting Permissions

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