Buying Javascript Onclick Change 2 Values and Submit

Discussion in 'Programming' started by EatingEmoKids, Jan 6, 2012.

  1. #1
    This Task has now been completed. Thanks for your replies!

    Hi,

    I'm looking for someone to help me with this javascript as I don't know the language enough to make this happen.

    I currently have the following code:
    
    <form name="language" action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
        <div id="language">
    	<img src="image/flags/se.png" alt="Svenska" title="Svenska" onclick="$('input[name=\'language_code\']').attr('value', 'se').submit(); $(this).parent().parent().submit();" />
    	<img src="image/flags/dk.png" alt="Danish" title="Danish" onclick="$('input[name=\'language_code\']').attr('value', 'dk').submit(); $(this).parent().parent().submit();" />
    	<img src="image/flags/gb.png" alt="English" title="English" onclick="$('input[name=\'language_code\']').attr('value', 'en').submit(); $(this).parent().parent().submit();" />
    	<input type="hidden" name="language_code" value="" />
    	<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
        </div>
    </form>
    Code (markup):
    I would like to change it to something like this:
    
    <form name="language" action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
        <div id="language">
    	<img src="image/flags/se.png" alt="Svenska" title="Svenska" onclick="$('input[name=\'language_code\']').attr('value', 'se').submit(); $('input[name=\'currency_code\']').attr('value', 'SEK').submit(); $(this).parent().parent().submit();" />
    	<img src="image/flags/dk.png" alt="Danish" title="Danish" onclick="$('input[name=\'language_code\']').attr('value', 'dk').submit(); $('input[name=\'currency_code\']').attr('value', 'DKK').submit(); $(this).parent().parent().submit();" />
    	<img src="image/flags/gb.png" alt="English" title="English" onclick="$('input[name=\'language_code\']').attr('value', 'en').submit(); $('input[name=\'currency_code\']').attr('value', 'GBP').submit(); $(this).parent().parent().submit();" />
    	<input type="hidden" name="language_code" value="" />
            <input type="hidden" name="currency_code" value="" />
    	<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
        </div>
    </form>
    Code (markup):
    Obviously the above code does not work. I'd like the onclick event to set the value for both the language_code and currency_code and then submit the form.

    I assume this is fairly easy to do so the price is $5.00, that being said if it requires more programming then I'm assuming I'd be willing to pay more.

    Feel free to contact me on skype or via PM or just reply to this thread with the fix.

    Payment will be made via PayPal.
     
    Last edited: Jan 6, 2012
    EatingEmoKids, Jan 6, 2012 IP
  2. thewpdev

    thewpdev Well-Known Member

    Messages:
    137
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Are you still looking for someone to do this?
     
    thewpdev, Jan 6, 2012 IP