JQuery Issue - Magento Custom Fields
<p>I am trying to figure how to do something in JQuery and I need a little bit of help. What I think I need to do is a RegEx search and then match of specific fields.</p>

<p>I basically have a Magento store, and it has 3 custom fields, they all have a name like below</p>

<pre><code>options_22_text
options_23_text
</code></pre>

<p>Basically they have options_number_text (replace number with a random number).</p>

<p>For each page I need pick-up the 3 custom fields (in the order they are displayed on the page) and</p>

<p>This is what I have got so far, but because the number changes it does not work for all pages</p>

<pre><code>jQuery(document).ready(function() {
    if (jQuery('#options_3_text').length &gt; 0){
        //Custom Options - Template: Description.phtml

        jQuery('#options_2_text').click(function() {
            //Make sure other fields are filled out first
            if (jQuery('#options_3_text').val() == "") {
                alert('You must enter the first line!');
                jQuery('#options_3_text').focus();
            }
        });

        jQuery('#options_1_text').click(function() {
            //Make sure other fields are filled out first
            if (jQuery('#options_3_text').val() == "") {
                alert('You must enter the first line!');
                jQuery('#options_3_text').focus();
            }
        });
    }
});
</code></pre>

<p>Basically the person needs to fill in the first text field because it adjusts the price. I need to find out a nice way of doing this - please help!?</p>
