Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8279445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:20:45+00:00 2026-06-08T09:20:45+00:00

Current HTML snippet: <ul class=ShippingProviderList> <li> <label id=shippingMethod_500dae76abe48_0> <input id=shippingCheck_500dae76abe48 type=radio value=0 name=selectedShippingMethod[500dae76abe48] />

  • 0

Current HTML snippet:

<ul class="ShippingProviderList">
  <li>
    <label id="shippingMethod_500dae76abe48_0">
      <input id="shippingCheck_500dae76abe48" type="radio" value="0" name="selectedShippingMethod[500dae76abe48]" />
      <span class="ShipperName">My Own Shipping Account (Please make sure that account number is specified within your account page or item will not ship!)</span>
      <em class="ShipperPrice ProductPrice">$0.00</em>
    </label>
  </li>
  <li> 2nd option may or may not be here </li>
</ul>

Current Javascript snippet:

<script>
var radio = document.getElementById('shippingCheck_500d6aa9a300e'),
var input1 = document.getElementById('FormField_25'),
input2 = document.getElementById('FormField_26'),
btn = document.getElementById('ML20').getElementsByTagName('input')[0];

btn.onclick = function(e) {
if( radio.checked && input1.value.length >= 20 && input2.value.length >= 20 ) {
    alert('Please provide a Shipping Account Number in either the Billing or Shipping sections in order to use your own Shipping Account.');
    e.preventDefault(); // we all stop the submit from happening.
    e.stopPropagation();
    return false;
}
// otherwise do something or nothing and let the submit happen.
};
</script>

The problem is that the 500d shipping check is randomly generated, and I have no control over such. is it possible to adjust the Javascript to pull the proper data by say using the span class “ShipperName” that has the term My Own Shipping in it, then pull the input field before that? or is there a better way to do this that I am missing? I am not able to assign an ID, Class, or change the actual html generated there in any way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T09:20:49+00:00Added an answer on June 8, 2026 at 9:20 am

    If jQuery is acceptable, you can use this:

    $("input[id^='shippingCheck']")
    

    Using normal Javascript, you can use this function:

    function wildcard(startingId){
      // get all inputs
      var inputs = document.getElementsByTagName("input");
      // iterate over them
      for ( var i = 0; i < inputs.length; i++ ) {
    
        if ( inputs[i].nodeType === 1 ) {
          // id start with 'shippingCheck' ?
          if (inputs[i].id.indexOf(startingId) == 0)
          {
             return inputs[i];
          }
        }
      }
    }
    

    And call it like this:

    wildcard("shippingCheck")
    

    You can try this:

    function fetchInput() {
        var input;
        $(".ShipperName").each(function() {
            if ($(this).text().indexOf("My Own Shipping Account") != -1)
            {
                input = $(this).prev().get(0);
                return;
            }
        });
        return input;
    }
    

    And call it like this:

    fetchInput();
    

    The function returns the DOM element, so you can access the id attribute, for example, like this:

    var inputId = fetchInput().id;
    

    You basically just want your radio variable to be a reference to the DOM element, right? So you would use this:

    var radio = fetchInput();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Html.CheckBox() . The resulting HTML is: <input id=IsMultiGraph name=IsMultiGraph value=true type=checkbox>
I'm using Sass (.scss) for my current project. Following example: HTML <div class=container desc>
i have this html menu: <ul id='main'> <li class='active current' id='lighty'> <a href='/'>Lighty</a> <ul>
Please see my current html snippet is as below. I am trying to make
My current html looks like this: <div class=wrapper style=display:block; id=item0><!--- Stuff --></div> <div class=wrapper
I'm working on this html snippet: <p class=pageSelector> <a href=/BlaBla>&lt; Prev</a>&nbsp; <a href=/BlaBla>1</a>&nbsp; <a
I have the following HTML: Current HTML <div id=testContainer> <a href=testPage.htm target=_top> <img src=/res/images/testImage_M.jpg?lc=en-GB&lv=5.jpg
The JavaScript code window.print() can print the current HTML page. If I have a
Is there a javascript script that returns the current html of the window? I
I'm trying to follow this documentation on Symfony : http://symfony.com/doc/current/book/forms.html ok so here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.